#### Check if a Linked List is a Palindrome

This function checks whether a given linked list is a palindrome. If the linked list is 1 -> 2 -> 3 -> 2 -> 1, the function will return True.

#### Problem

```Implement a function to check if a given linked list is a palindrome.
Input: 1 -> 2 -> 3 -> 2 -> 1
Output: True```

#### Solution

This solution is in Python. Our A.I. can create solutions in multiple languages.
by kayakane
```# Solution:
# The solution is to reverse the linked list and compare it to the original.
# This is optimal because it only requires one pass through the linked list.

class Node:
def __init__(self, data):
self.data = data
self.next = None

def __init__(self):

def append(self, data):
new_node = Node(data)
return
while last_node.next:
last_node = last_node.next
last_node.next = new_node

def print_list(self):
while cur_node:
print(cur_node.data)
cur_node = cur_node.next

def reverse(self):
prev = None
while cur:
nxt = cur.next
cur.next = prev
prev = cur
cur = nxt

def is_palindrome(self):
self.reverse()
while cur:
return False
cur = cur.next
return True