Nextag Interview Question
Software Engineer / DevelopersCountry: India
Interview Type: In-Person
Using a Trie would make a lot of sense here.
Say what you desire to store are phone numbers, at the leaf nodes we could save the name of the contact.
This would enable us with a quick search (number based) , add or delete/edit operation in optimized space.
I am guessing further applying some compression algorithm over the Trie could further optimize the space usage.
Please correct me if I'm wrong.
It will depend on what operatiosn you would like to perform.
- it_code October 26, 2013