it is not always true.. like you have to store all distinct strings somewhere to be compared.. so you can go for hashing also... but in that case different strings will take more space to store and it is tough to find a good hash function.. however in trie you are using a character only once at level....so now your look up will be fast and it will be O(n).. if you have any better space efficient solution..then let me know.....
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.