Here's my code to find palindrome in string..But surely it's too slow..Is there any good algorithms for such problems..And for some cases it's not giving the right answer.Thanks for the help.
nirbilcahn
0
Newbie Poster
Recommended Answers
Jump to PostYour code has lot of constraint to check, but there is an simple solution for this one, just reverse the given string and compare it with the original string, if it matches then its palindrome or else it is not a palindrome...here is a code sample
int …
Jump to PostYour code won't print all palindromes in all cases:
A palindrome can contain other palindromes that aren't its "inner strings". Take the string "kakykak" for example. Your algorithm will find "kakykak", "akyka" and "kyk", but not the two "kak"s.
Another problem is that palindromes can overlap. For example "akala" contains …
All 7 Replies
Trap910
0
Newbie Poster
nirbilcahn
0
Newbie Poster
vijayan121
1,152
Posting Virtuoso
sepp2k
378
Practically a Master Poster
Labdabeta
182
Posting Pro in Training
Featured Poster
sepp2k
378
Practically a Master Poster
iamthwee
commented:
nice
+14
vijayan121
1,152
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.