MongoDB interview question

Write a function to convert a non-decreasing list of ints to a balanced binary tree.