public TreeNode sortedListToBST(ListNode head) {
		TreeNode median;
		if (head == null) {
			return null;
		} else if (head.next == null) {
			return new TreeNode(head.val);
		}
		// else if(head.next.next == null){
		// //ListNode next = head.next;
		// median = new TreeNode(head.next.val);
		// head.next = null;
		// median.left = sortedListToBST(head);
		// return median;
		// }

		ListNode step1 = head;
		ListNode step2 = head;
		ListNode preStep1 = head;

		int count = 0;
		while (step2 != null) {
			if (step2.next == null)
				break;
			if (count != 0) {
				// use to cut the next point to median node
				// System.out.println("~~"+head.val);
				preStep1 = preStep1.next;
			}
			step1 = step1.next;
			step2 = step2.next.next;
			count++;
		}
		preStep1.next = null;
		median = new TreeNode(step1.val);
		median.left = sortedListToBST(head);
		median.right = sortedListToBST(step1.next);
		return median;
	}