Open
Description
Add Palindrome Check Function for Linked Lists
Description:
A palindrome check function is needed for linked lists to determine if the sequence of elements in the linked list reads the same forwards and backwards. This function should work for all types of linked lists (Singly, Doubly, Circular, etc.).
Proposed Solution:
Implement a is_palindrome
method in the LinkedList
class. This method will:
- Traverse the linked list and store the elements in a temporary array.
- Compare the array with its reverse to determine if it is a palindrome.
- Return
True
if the linked list is a palindrome, otherwiseFalse
.
Metadata
Metadata
Assignees
Labels
No labels