public TreeNode sortedListToBST2(ListNode head) {
		// IMPORTANT: Please reset any member data you declared, as
		// the same Solution instance will be reused for each test case.
		if (head == null) {
			return null;
		} else if (head.next == null) {
			return new TreeNode(head.val);
		}
		int len = 0;
		ListNode node = head;
		while (node != null) {
			++len;
			node = node.next;
		}
		ListNode [] h = new ListNode[]{head};
		return buildBST(h, 0, len - 1);
	}