Yes...You cant use suffix trees here...Forget Coding...can anybody even
explain the algo as to how suffix trees or tries can be used here ?
On Tue, Sep 20, 2011 at 12:45 AM, pooja wrote:
> exactly.. to implement suffix tree was out f my reach atleast during
> the test. even thou i knew dat it
exactly.. to implement suffix tree was out f my reach atleast during
the test. even thou i knew dat it ws d correct DS to use. i cudn't
actlly use it.
On Sep 19, 11:51 pm, hary rathor wrote:
> can anybody tell about other approach because suffix tree is very thought to
> implement at interview or
can anybody tell about other approach because suffix tree is very thought to
implement at interview or written test time
--
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 unsub
Suffix Tree
On Sep 18, 4:17 pm, pooja wrote:
> Can some one please help me with this..
> the problem is to find the longest substring in a list of around 100
> strings..??
> any idea..
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To pos
store strings in array of pointers...char *str[100]
str[0]str[99]
make every possible suffix and prefix for each string...
for ex. str[0]="ababa"
possible suffix={ababa,abab,aba,ab,a}
possible prefix={ababa,baba,aba,ba,a}
so make a structure for storing these suffix and prefixes and their co
sorry.. i meant the longest common substring..
eg. consider 4 string.. ababa , bab , babba, abab
so the longest common substring is bab.
On Sep 18, 4:40 pm, Yogesh Yadav wrote:
> struct string_node
> {
> char str[];
> int length;
> struct string_node *ptr;
>
> }
>
> now traverse the strings a