//Taken from careercup.com
Design the autocomplete feature (ex:Google Suggest)
I assumed {"abcde","abcegh","abcpqr","abcxyz","xyz" ,"abcmno"} URLs
and stored them in trie...Such if the user enters abc ...the o/p will
be
abc is a prefix in 5 number of cases
d e
e g h
m n o
p q r
x y z
Now say if I add more strings of the form abcdpqr,"abcdprst"..How can
I modify this code such that now thw o/p is
d e
e g h
m n o
p q r
x y z
d p q r
d p r s t
code in c :-
http://ideone.com/rBvQb
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.