Add is_palindrome method to LinkedList class#657
Conversation
- Implemented `is_palindrome` method to check if a linked list is a palindrome. - The method works for all types of linked lists: SinglyLinkedList, DoublyLinkedList, SinglyCircularLinkedList, and DoublyCircularLinkedList. - Added comprehensive test cases to verify the functionality.
czgdp1807
left a comment
There was a problem hiding this comment.
is_palindrone is applicable to any linear data structure right? So let's add it in linear_data_structures/algorithms.py. Keep the method here and call it in is_palindrone in algorithms.py file. Also implement is_palindrone method in OneDimensionalArray, DynamicOneDimensionalArray.
@czgdp1807 So do you want to keep the method here and also add |
What's this PR about?
This PR adds a new method
is_palindrometo theLinkedListclass to check if a linked list is a palindrome. The method works for all types of linked lists:SinglyLinkedList,DoublyLinkedList,SinglyCircularLinkedList, andDoublyCircularLinkedList.What changes were made?
New Method:
is_palindrometo theLinkedListclass.Tests:
is_palindromein the test file.Fixes: #656