Length of longest palindrome in linked list

Given an linked list which are contain n nodes. Our goal is to find the largest length palindrome which are exist in this linked list. Note that there can be possible more than one palindrome in linked list.

Length of longest palindrome in linked list

In above image there are more than one palindrome are possible.

3  2  2  3 [Length 4]
2  2 [Length 2]
2  3  1  1  3  2 [Length 6]
3  1  1  3 [Length 4]

Here given code implementation process.




Comment

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment







© 2022, kalkicode.com, All rights reserved