13431 - Palindrome Linked List   

Description

Do you notice that the ID of this problem is a palindrome number? This problem, though, requires you to determine whether a linked list is a palindrome - it reads the same backwards as forwards.

Please implement a function to detect whether the linked list given is a palindrome or not.

Input

Since this problem is judged partially, you needn't be concerned about the format of input.

The length of the linked list is at least 1 and won't exceed 100000.

In case your're interested in sample I/O, there are several test cases in a file, which starts with a interger n indicating the length of the list and the next line contains n intergers.

Output

Since this problem is judged partially, you needn't be concerned about the format of output.

In case your're interested in sample I/O, for each test case, if the list is a palindrome, it should print a single T, otherwise print a F. There should be a new line at the end of file (EOF).

Sample Input  Download

Sample Output  Download

Partial Judge Code

13431.c

Partial Judge Header

13431.h

Tags




Discuss