binary tree: create balanced tree from array