public TreeNode sortedListToBST(ListNode head) {
		if (head == null)
			return null;
		ArrayList<ListNode> A = new ArrayList<ListNode>();
		ListNode node = head;
		A.add(node);
		while (node.next != null) {
			A.add(node.next);
			node = node.next;
		}
		TreeNode root = buildTree(A);
		return root;
	}