Search in a Trie
Learn the algorithm for a word search in a trie. This lesson highlights the different scenarios which are taken care of in the algorithm.
We'll cover the following...
Search algorithm
If you want to check whether a word is present in the trie or not, you need to keep tracing the path in the trie that is corresponding to the characters in word.
The logic isn’t too complex, but there are a few cases you need to take care of.
Case 1: Non-Existent word
If you are searching for a word that doesn’t exist in the trie and is not a subset ...