Digital Dict (Trie)

I am facing some difficulty in understanding trie data structure. Can you please point out my mistake? Code is present at https://ide.codingblocks.com/s/185320.

Hey @tisandas2011
Your code is as such fine. The issue is with output begin in sorted order. Since you’re using unordered_map you’re printing output in not necessarily sorted order. Replace unordered_map with map and your code will work.

Thanks for the help…

1 Like