We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This isn't a Trie. The fact that it can be used to quickly answer the 'how many contacts start with this prefix?' query doesn't somehow make it a Trie.
An actual Trie would take up quite a bit less space, and doesn't have the risk of hitting a table reallocation operation that hashtables occasionally hit.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Contacts
You are viewing a single comment's thread. Return to all comments →
This isn't a Trie. The fact that it can be used to quickly answer the 'how many contacts start with this prefix?' query doesn't somehow make it a Trie.
An actual Trie would take up quite a bit less space, and doesn't have the risk of hitting a table reallocation operation that hashtables occasionally hit.