摘要:
Well, there many ways to solve this problem. Let's first look at a naive solution.The basic idea is simple. Starting from the first character of the s... 阅读全文
摘要:
The key of this problem is that we need not build the tree from scratch. In fact, we can direct obtain its post-order traversal results in a recursive... 阅读全文
摘要:
This is a application of the Trie data structure, with minor extension. The critical part in this problem is to count all the words that have a partic... 阅读全文
摘要:
A direct applicatin of the heap data structure. Specifically, a max heap is used. The required functions include insertion of a node to the heap and e... 阅读全文
摘要:
The idea is to usetwo stacks.Forpush, the first stack records the pushed elements and the second stack recordsallthe minimum (including duplicates) th... 阅读全文
摘要:
This problem is an application of the Trie data structure. In the following, it is assumed that you have solvedImplement Trie (Prefix Tree).Now, let's... 阅读全文