static TreeNode bstHelper(ListNode head, int n) {
		if (n==0) {
			return null;
		} else if (n==1) {
			return new TreeNode(head.val);
		} 
		int m=n/2, ls=m, rs=n-ls-1;
		ListNode c=head;
		for (int i=0;i<m;++i)
			c=c.next;
		TreeNode node=new TreeNode(c.val);
		node.left=bstHelper(head,ls);
		node.right=bstHelper(c.next,rs);
		return node;
	}