How to implement PhoneBook using tries data structure.
Phone Book
4 min readJun 1, 2020
Design a data structure to store your contacts: Names of people along with their phone numbers.The data structure should be able to do the following quickly:
- Add contacts.
- Lookup the phone number by name.
- Determine who is calling given their phone number.
To do that:
To implement this we will be using HashMap and Trie data structure. Trie data help us to search and provide suggestion on basis…