public treeNode generateBalancedBST(ArrayList<Integer> nodeList,
			int startIndex, int endIndex) {
		if (startIndex > endIndex) {
			return null;
		}

		if (startIndex == endIndex) {
			treeNode root = new treeNode(nodeList.get(startIndex));
			return root;
		}

		int rootIndex = (startIndex + endIndex) / 2;
		treeNode root = new treeNode(nodeList.get(rootIndex));
		root.leftLeaf = generateBalancedBST(nodeList, startIndex, rootIndex - 1);
		root.rightLeaf = generateBalancedBST(nodeList, rootIndex + 1, endIndex);

		return root;
	}