js/index.js
function toTree(arr, low, high) {
	if (low >= high) {
		return undefined;
	}
	var mid = Math.floor((high + low) / 2);
	return {
		el: arr[mid],
		right: toTree(arr, mid + 1, high),
		left: toTree(arr, low, mid)
	};
}
function toTree(arr, low, high) {
	if (low >= high) {
		return undefined;
	}
	var mid = Math.floor((high + low) / 2);
	return {
		el: arr[mid],
		right: toTree(arr, mid + 1, high),
		left: toTree(arr, low, mid)
	};
}
function toTree ( arr , low , high ) { if ( low >= high ) { return undefined ; } var mid = Math . floor ( ( high + low ) / 2 ) ; return { el : arr [ mid ] , right : toTree ( arr , mid + 1 , high ) , left : toTree ( arr , low , mid ) } ; }
Build a balanced binary tree from an ordered array.
Build a balanced binary tree from an ordered array .