@@ -0,0 +1,954 @@
+/**%0A *%09Reverse a singly linked list.%0A *%0A *%09Author: matao%0A */%0A%0Aclass ListNode %7B%0A%09int val;%0A%09ListNode next;%0A%09ListNode(int x) %7B val = x; %7D%0A%7D%0A %0A%0Apublic class ReverseLinkedList %7B%0A%09public static ListNode reverseList(ListNode head) %7B%0A%09%09ListNode pre = null;%0A        while(head != null) %7B%0A            ListNode temp = head.next;%0A            head.next = pre;%0A            pre = head;%0A            head = temp;%0A        %7D%0A        return pre;%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09ListNode head = new ListNode(0);%0A%09%09ListNode node1 = new ListNode(1);%0A%09%09ListNode node2 = new ListNode(2);%0A%09%09ListNode node3 = new ListNode(3);%0A%09%09head.next = node1;%0A%09%09node1.next = node2;%0A%09%09node2.next = node3;%0A%09%09while(head != null) %7B%0A%09%09%09System.out.print(head.val + %22-%3E%22);%0A%09%09%09head = head.next;%0A%09%09%7D%0A%09%09System.out.println();%0A%0A%09%09ListNode result = reverseList(head);%0A%09%09while(result != null) %7B%0A%09%09%09System.out.print(result.val + %22-%3E%22);%0A%09%09%09result = result.next;%0A%09%09%7D%0A%09%09System.out.println();%0A%09%7D%0A%7D

add Reverse Linked List solution