Introduction
It is such a great blessing to have a peer to share his experience. I learn one more algorithm from the peer today. The peer told me that I should not choose Trie data structure right away, I have to ask questions to collect use cases, and then define the data structure for each case.
20 minutes discussion
Here is the algorithm we discussed in 20 minutes. I tried to give out a solution using Trie, and then I define Trie class using recursive tree.
It is most important to write a basic solution using recursive function first. Here is C++ code I like to review later.
No comments:
Post a Comment