Re: [algogeeks] Amazon - max substring
i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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.
Re: [algogeeks] Amazon - max substring
It does but i am asked to code.. if you know the code for suffix tree then please provide.. On Wed, Jun 29, 2011 at 10:30 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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.
Re: [algogeeks] Amazon - max substring
I dnt think any company is gonna ask u to code suffix tree..:P :P On 6/29/11, Swathi chukka.swa...@gmail.com wrote: It does but i am asked to code.. if you know the code for suffix tree then please provide.. On Wed, Jun 29, 2011 at 10:30 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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.
Re: [algogeeks] Amazon - max substring
I dont know why people reply in plain words.. I personally had this experience and i was asked to code but i couldn't On Wed, Jun 29, 2011 at 10:53 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: I dnt think any company is gonna ask u to code suffix tree..:P :P On 6/29/11, Swathi chukka.swa...@gmail.com wrote: It does but i am asked to code.. if you know the code for suffix tree then please provide.. On Wed, Jun 29, 2011 at 10:30 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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.
Re: [algogeeks] Amazon - max substring
chk this and try to write urself http://www.allisons.org/ll/AlgDS/Tree/Suffix/ people hv right to decide if they want to WAP or not. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jun 29, 2011 at 10:55 PM, Swathi chukka.swa...@gmail.com wrote: I dont know why people reply in plain words.. I personally had this experience and i was asked to code but i couldn't On Wed, Jun 29, 2011 at 10:53 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: I dnt think any company is gonna ask u to code suffix tree..:P :P On 6/29/11, Swathi chukka.swa...@gmail.com wrote: It does but i am asked to code.. if you know the code for suffix tree then please provide.. On Wed, Jun 29, 2011 at 10:30 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- 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.
Re: [algogeeks] Amazon - max substring
I never said you don't have right but even after saying they asked me to write the code.. you are asking the same question which is not at all good.. On Wed, Jun 29, 2011 at 11:01 PM, Ashish Goel ashg...@gmail.com wrote: chk this and try to write urself http://www.allisons.org/ll/AlgDS/Tree/Suffix/ people hv right to decide if they want to WAP or not. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jun 29, 2011 at 10:55 PM, Swathi chukka.swa...@gmail.com wrote: I dont know why people reply in plain words.. I personally had this experience and i was asked to code but i couldn't On Wed, Jun 29, 2011 at 10:53 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: I dnt think any company is gonna ask u to code suffix tree..:P :P On 6/29/11, Swathi chukka.swa...@gmail.com wrote: It does but i am asked to code.. if you know the code for suffix tree then please provide.. On Wed, Jun 29, 2011 at 10:30 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- 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. -- 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.
Re: [algogeeks] Amazon - max substring
jokes apart...then i think it can be done using dynamic programming using the similar approach of LCS but the time and space complexity both will be N^2.i am working on the pseudocode and post it within a few moments if it works.. On 6/29/11, Swathi chukka.swa...@gmail.com wrote: I dont know why people reply in plain words.. I personally had this experience and i was asked to code but i couldn't On Wed, Jun 29, 2011 at 10:53 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: I dnt think any company is gonna ask u to code suffix tree..:P :P On 6/29/11, Swathi chukka.swa...@gmail.com wrote: It does but i am asked to code.. if you know the code for suffix tree then please provide.. On Wed, Jun 29, 2011 at 10:30 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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.
Re: [algogeeks] Amazon - max substring
how abt two passes first one makes a multi map of char and its positions second one a bit tricky to eg abcabcabc first pass a,0,3,6, b,1,4,7 c,2,5,8 second pass first char is a, its next position is 3(find thrugh the map) repeated substring can be of length 3 for loop with this (count-1) if three char matchs, mean repeat, otherwise move to next position eg 6 in this case for a and compare str[1] to str[6] for next 6-0-1 chars and see if 6 chars match this way and so on... if no repeat is found this way, move to next char in the string i.e. str[1] in this case.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jun 29, 2011 at 11:10 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: jokes apart...then i think it can be done using dynamic programming using the similar approach of LCS but the time and space complexity both will be N^2.i am working on the pseudocode and post it within a few moments if it works.. On 6/29/11, Swathi chukka.swa...@gmail.com wrote: I dont know why people reply in plain words.. I personally had this experience and i was asked to code but i couldn't On Wed, Jun 29, 2011 at 10:53 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: I dnt think any company is gonna ask u to code suffix tree..:P :P On 6/29/11, Swathi chukka.swa...@gmail.com wrote: It does but i am asked to code.. if you know the code for suffix tree then please provide.. On Wed, Jun 29, 2011 at 10:30 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: i think suffix tres will do the job if i have not misunderstood the question... On 6/29/11, Swathi chukka.swa...@gmail.com wrote: Given a string (assume there no spaces or punctuations), write a code that returns the max. length of the string that has repeated more than once. Thanks, Swathi -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- 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. -- 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.