netflix's blog

By netflix, history, 7 years ago, In English

Whenever I solve a question using the Keyword Tree / Trie data-structure, I implement it using pointers. But I have seen many programmers implementing trie using arrays.

What are the downsides of using the Pointers implementation (if at all) , as compared to the Arrays implementation ?

Pointers Implementation Code

Arrays Implementation Code

Happy Coding !

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By netflix, history, 8 years ago, In English

In this question I am applying DFS to solve it. I go down to the lowest level of any word. Then again I apply DFS from the next word. But I am being given TLE on test case 29 continuously. In test case 29, there is only one string with no children : string,0 (something like this). Can someone help me with my code or is my complexity itself too high for my solution to be correct. Here is my solution link : http://ideone.com/hiaumA . Thank-you in advance.

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it