Linked List in Java - 83: Length of longest palindrome list in a linked list

preview_player
Показать описание

Solution:
- We'll start from head node of linked list & keep on checking the common element at every step
- We need to reverse element as we iterate nodes & compare common elements at both lists
- Whenever we've match, store palindrome length.
- Time Complexity: O(n^2)
- Space Complexity: O(1) as we're taking only constant variables

Please check video for more info:

This problem is similar to:
Length of longest palindrome list in a linked list in java,
Length of longest palindrome list in a linked list,
how to get Length of longest palindrome list in a linked list,
longest palindrome list,
get length of longest palindrome list,
find length of longest palindrome list,
linked list,
tutorial,
coding simplified,
java

CHECK OUT CODING SIMPLIFIED

★☆★ VIEW THE BLOG POST: ★☆★

I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 400+ videos.

★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★

★☆★ SEND EMAIL At: ★☆★
Рекомендации по теме
Комментарии
Автор

Thank you so much sir. The solution given on geeks for geeks was so ambiguous and won't work for even length elements (I think).

AJ-jqhm
welcome to shbcf.ru