|
|
back to boardShow all messages Hide all messagesYou should build a trie, which to store the word. 1.Build the trie in reverse order 2.Make suffix links in BFS order. 3.Process the text But my algo must read the text in reverse order,so it has to use more 2000K :( Otherwise, 1500K is enough. How many vertex did you use in your tree? Now I've solved it. We can only record the char on the node, not the pointer. |
|
|