Binary tree based on array