Back to course home
0% completed
Problem 4: Find if Doubly Linked List is a Palindrome (easy)
Problem Statement
Given a doubly linked list, determine whether it is a palindrome.
A doubly linked list is a palindrome if it reads the same backward as forward, utilizing the previous and next pointers of the nodes.
Examples
-
Example 1:
- Input: 1 <-> 2 <-> 3 <-> 2 <-> 1
- Output: true
- Justification: The list reads the same backward as forward.
-
Example 2:
- Input: 1 <-> 2 <-> 2 <-> 3
- Output: false
- Justification: Reading backward, the list is 3 <-> 2 <-> 2 <-> 1, which is not the same as reading forward.
3
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible