LeetCode 234. Palindrome Linked List [Solution + Code Explained ]

preview_player
Показать описание
One of the most frequently asked coding interview questions on Dynamic Programming in companies like Google, Facebook, Amazon, LinkedIn, Microsoft, Uber, Apple, Adobe etc.

LeetCode 234. Palindrome Linked List

Question : Given a singly linked list, determine if it is a palindrome.

Example 1:

Input: 1-2
Output: false
Example 2:

Input: 1-2-2-1
Output: true
Follow up:
Could you do it in O(n) time and O(1) space?

Рекомендации по теме
Комментарии
Автор

Thank you. You solve the way a beginner will think. Great work. God bless you.

AbhinavKumar-dref
Автор

Yaa it's amazing, but please use quality Microphone

hameedmulani
Автор

very nice explanation, it became easy to understand. thanks alot.

rounakbhattacherje
Автор

Very well explained. Keep up the good work. Thanks

shyam
Автор

Hey Jayati it's an amazing explanation
Keep the videos Comin.
Much love and support💕

tanishktripathi
Автор

Just to be clear, so we reverse the right half of the linked list and then compare it with the left side. If they have the same values, then it is palindrome am I right? Thank you!

abigailgonzalez
Автор

Thank you Jayati! Do you know why we can't reverse the entire list and compare them?

pajichan
Автор

Thanks, but easier to think fp==null means sp is mid i think? :)

erikm
Автор

Love your explanation, thank you so much, could you please write your code in javaScript too.

chamnil
Автор

Love you for nice explanation and you r looking so beautiful 👌👌👌

rajan