Sir, how can we find no. of occurences of a subtring in a trie?
Trie data structure
@yashme7125 ya you can do that for that just traverse all the way out to string which you want to search in all other strings then traverse until you get a terminal node but this will only work when the string matches another substring starting with index 0 like for example you can only match code and codechef efficiently and if you want to search a pattern in all substrings of a text its better to use KMP or Rabin Karp alogorithm
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.