How can I keep two same string as two different one in policy based trie data structure ?

Revision en1, by Sukarna_Paul, 2019-08-06 07:18:35

I was solving a problem from spoj, Link. I need to keep two same string in the prefix_trie. For first query the answer 2, but I am getting 1. Because the duplicate is not counted. My code link . One more thing I want to how can I print the size of prefix range in O(1). Please Help.

Tags trie tree, policy based, #data structure

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sukarna_Paul 2019-08-06 07:18:35 450 Initial revision (published)