public ListNode reverseList(ListNode head) {
		if (head == null || head.next == null)
			return head;
		ListNode ptr = new ListNode(-1);
		ptr.next = head;
		ListNode res = ptr;
		ListNode first = head;
		while (first != null) {
			ListNode temp = first.next;
			first.next = ptr;
			ptr = first;
			first = temp;
		}
		res.next.next = null;
		return ptr;
	}