@Prem

I know the implementation of trie...But I have doubt that say I have
struct trie * current..
and input = "abc"...The last character matched with head->CHILDREN[i]-
>letter will be 'c'... now "current" points to c....

next step- there will be 4 branches from
'c'..."de","xyz","efgh","pqr"...

Now  if write
for(i=0;i<26;i++)
{
if (current->CHILDREN[i]!=NULL && current->CHILDREN[i]->islast==0)
{
cout<<"  "<<current->CHILDREN[i]->letter; //d   e
current = current->CHILDREN[i];//head now points to 'e'
}
}



////The problem I am facing is how to take back current pointer to 'c'
so that now I get "efgh" as output...and secondly how can I make sure
that this time 'd' node is not selected again???

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to