Is Linked List A Palindrome?
1. You are given a partially written LinkedList class. 2. You are required to complete the body of IsPalindrome function. The function is expected to check if the linked list is a palindrome or not and return true or false accordingly. 3. Input and Output is managed for you.
1. Time complexity -> O(n) 2. Space complexity -> Recursion space, O(n)
Input is managed for you
Output is managed for you
5 1 2 3 2 1