if leaf node then print key
if ( node . child [ i ] . index != - 1 ) { System . out . print ( arr [ node . child [ i ] . index ] + " ▁ " ) ; } preorder ( node . child [ i ] , arr ) ; } } return false ; } static void printSorted ( String arr [ ] , int n ) { Trie root = new Trie ( ) ;