http://www.allisons.org/ll/AlgDS/Tree/Suffix/#demoForm
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Wed, Dec 28, 2011 at 11:27 AM, sumit mahamuni sumit143smail...@gmail.com
wrote:
Slow code that scales better can be faster than fast code
@sumit : whats your nlogn approach ???
On Wed, Dec 28, 2011 at 11:27 AM, sumit mahamuni sumit143smail...@gmail.com
wrote:
Here I can think of O( n * log n ). can anyone think of better solution??
On Tue, Dec 27, 2011 at 11:06 PM, atul007 atul.87fri...@gmail.com wrote:
Given a string of
@atul I am not sure whether I got ur question correctly.If you only want to
check whether an even palindrome exist or not,then u can check for whether
adjacent characters are same or not.It is very simple.If you want the
longest string then its gets difficult.Same algo can be also used for
@atul If we need to find the longest palindrome whether even or odd we can
use DP.The recursion can look this:
LP(i,j) = max( LP(i+1,j),LP(i,j-1) if(string[i]!=string[j])
max( LP(i+1,j),LP(i,j-1),LP(i+1,j-1)+1 ) else
Note : Do
Given a string of length N, find whether there exits an even length
palindrome substring.
what would be efficient way of solving this problem.?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
one solution could be :-
hash every even number substring , starting from beginning.
after this.
hash every even number substring , starting from end.
if it exists..means palindrome exists.
complexity would be O(N^2).
On Tue, Dec 27, 2011 at 11:06 PM, atul007 atul.87fri...@gmail.com wrote:
Here I can think of O( n * log n ). can anyone think of better solution??
On Tue, Dec 27, 2011 at 11:06 PM, atul007 atul.87fri...@gmail.com wrote:
Given a string of length N, find whether there exits an even length
palindrome substring.
what would be efficient way of solving this problem.?