Apply DFS in the trie
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
*--*
sapraaks...@gmail.com
akshatsapr...@gmail.com
rit20009008@ rit20009...@gmail.comiiita.ac.in
--
You received this message because you are subscribed to the
first search for node where abc ends i.e say func Search() will return
node whose
node-ch='c';(last character of input abc)
then pass this node to following algo :-
this is just a code sketchso you can add boundary conditions to
it..(if i miss it)
print(node *root,int j)
{
if(!root)
If there is a trie of following strings(say URLs)
abcde,abcegh,abcpqr,abcxyz,xyz
if input = abc
then output should be = de,egh,pqr,xyz
How can I code for this ???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
Well it Seems like problem is the DS here.
if U have the DS of trie as
struct trie {
char letter;// Not being general
boolean islast;
int startindex;
struct trie *next;
};
I am sure you
To: Algorithm Geeks algogeeks@googlegroups.com
Sent: Thursday, 28 June 2012 12:23 PM
Subject: [algogeeks] trie display
If there is a trie of following strings(say URLs)
abcde,abcegh,abcpqr,abcxyz,xyz
if input = abc
then output should be = de,egh,pqr,xyz
How can I code for this ???
--
You received
do similar to inorder traversal after reaching at node 'c'..you will get
the desired output and in dictionary order .
On Thu, Jun 28, 2012 at 12:23 PM, deepikaanand swinyanand...@gmail.comwrote:
If there is a trie of following strings(say URLs)
abcde,abcegh,abcpqr,abcxyz,xyz
if input = abc