Re: [algogeeks] Re: K-LCS

2011-09-19 Thread Ankur Garg
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

[algogeeks] Re: K-LCS

2011-09-19 Thread pooja
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

Re: [algogeeks] Re: K-LCS

2011-09-19 Thread hary rathor
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

[algogeeks] Re: K-LCS

2011-09-18 Thread Arun
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

Re: [algogeeks] Re: K-LCS

2011-09-18 Thread Yogesh Yadav
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

[algogeeks] Re: K-LCS

2011-09-18 Thread pooja
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