Sir can u plz explain
if(temp->children.count(ch)){
temp=temp->children[ch];
}else{
return false;}
Thanks
Doubt in searching trie
If the present node’s map has the next character then it will go to the address of next character. Else the word is not present.
sir im asking let if we input “apple”,“api” then what value of(temp->children.count(a)) gives
sir im facing a problem can u plz explain how searching work plz
Suppose:
a Here, suppose you have to find api. Then we start from a. Then in structure of a
/ map stores the address of p. So we go to p. Similarly, we go to i.
p
/ \ I we want to search “apr”. Since in map of structure of p there is no r So we return
p i false.
/
l
/
e