@Lucifier :

your 1st approach fails for the following cases:-

*aaaa*
*aa*bb*aa*
*aaa*gg*aaa*

etc....

basically for cases where the 1st two and last two character of the even
palindrome are same.

for eg:-

1 2 3 4
----------
b b b b

1st iteration :-

X = 1 1 1 1

2nd iteration :-

X= 1 1 1 2

 (pStrt - X[pStrt] + 1 == pRev) -> *3=4-2+1* this condition will satisfy
and loop will break.



On Fri, Dec 30, 2011 at 9:02 PM, atul anand <atul.87fri...@gmail.com> wrote:

> @praveen : question is to find longest even length pallindrome.
>
> there was some misunderstanding earlier.
>
> so if input is aaaa
> output string is = aaaa
>
> check lucifier post above.
>
> we discussed another question in the same post bcoz
> of initial misunderstanding :-
>
> Q) Given a string of length N, find whether there exits an even length
>  reverse substring of a substring.
>
> you can see mine or lucifier algo for this question.
>
>
> On Fri, Dec 30, 2011 at 8:23 PM, praveen raj <praveen0...@gmail.com>wrote:
>
>> The Question is: whther there exist a even length pallindrome or not....
>>
>> since for even ... the two consecutive character will be equal...
>>
>> so find two character which are equal.. consecutively......
>>
>>
>> PRAVEEN RAJ
>> DELHI COLLEGE OF ENGINEERING
>>
>>
>>  --
>> 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.

Reply via email to