@@ -0,0 +1,1151 @@
+package leetcode;%0A%0A/**%0A * https://leetcode.com/problems/palindrome-linked-list/%0A */%0Apublic class Problem234 %7B%0A    public static class ListNode %7B%0A        int val;%0A        ListNode next;%0A%0A        ListNode(int x) %7B%0A            val = x;%0A        %7D%0A    %7D%0A%0A    public boolean isPalindrome(ListNode head) %7B%0A        int length = 0;%0A        for (ListNode node = head; node != null; node = node.next) %7B%0A            length++;%0A        %7D%0A        int mid = (length / 2) + 1;%0A        ListNode prev = null;%0A        ListNode current = head;%0A        int start = 1;%0A        while (start != mid) %7B%0A            ListNode tmp = reverse(prev, current);%0A            prev = current;%0A            current = tmp;%0A            start++;%0A        %7D%0A        current = (length %25 2 == 0) ? current : current.next;%0A        while (prev != null && current != null) %7B%0A            if (prev.val != current.val) %7B%0A                return false;%0A            %7D%0A            prev = prev.next;%0A            current = current.next;%0A        %7D%0A        return true;%0A    %7D%0A    %0A    private ListNode reverse(ListNode a, ListNode b) %7B%0A        ListNode c = b.next;%0A        b.next = a;%0A        return c;%0A    %7D%0A%7D%0A

Solve problem 234