Function to check if a singly linked list is palindrome
Nov 1, 2020
def check_palindrome(self):
stack = []
temp = self.head
while(temp):
stack.append(temp.data)
temp = temp.next
stack1 = stack[::-1]
if stack1 == stack:
return True
return False