method 1) : we can reverse the string and find the longest common substring occurring in reversed string and original string.
method 2) : making a generalized suffix tree of string and reversed string ....and each node should depict whether the suffix belongs to string or reversed string .. then the deepest node having both the marker will be longest palindrome. On 8/21/11, Sanjay Rajpal <srn...@gmail.com> wrote: > i hvn't read about suffix trees. will u plz post a useful link ? > > > Sanju > :) > > > > On Sun, Aug 21, 2011 at 11:21 AM, MAC <macatad...@gmail.com> wrote: > >> suffix tree will solve it . >> >> >> On Sun, Aug 21, 2011 at 11:46 PM, priya ramesh < >> love.for.programm...@gmail.com> wrote: >> >>> how abt goimg with brute force?? check starting from first character if >>> first 2 chars frm a palin, then chck if first 3 form a palin... continue >>> until the end of string. >>> >>> Now starting from 2nd char, do the same. >>> >>> keep a var max to store the max value. >>> >>> -- >>> 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. >>> >> >> >> >> -- >> thanks >> --mac >> >> >> -- >> 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.