@shady Just an addition to the previous solution, in case u are not concerned about overlapping string i.e orig and rev strs overlap then all you need to do is remove the following condition and it shall work fine:
*(pStrt < pRev) // remove this condition.. On 30 Dec, 15:03, atul anand <[email protected]> wrote: > @shady : for this question > > Given a string of length N, find whether there exits an even length > reverse substring of a substring. > > you can use hastable , as i have mentioned above. > > > > > > > > On Thu, Dec 29, 2011 at 5:50 PM, shady <[email protected]> wrote: > > oh, i didn't read all the posts, anyway i have understood lucifier's > > O(n^2) time solution. > > > and ya what's the solution for this question? > > Given a string of length N, find whether there exits an even length > > reverse substring of a substring. > > > On Thu, Dec 29, 2011 at 2:23 PM, atul anand <[email protected]>wrote: > > >> @shady : lets go with this one:- > > >> given string = *abcdrdcba > > >> abcd != dcba - not a palindrome > >> **abcd != dcba - **not a palindrome * > >> * > >> *no even length palindrome found for the given string. > > >> given string = ab*cddc*abr > > >> even lenght palindrome found = cddc > > >> if another even length palindrome found report the longest one. > > >> -- > >> 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. > > > -- > > 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. -- 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.
