Palo Alto Networks Interview Question

Creating a binary search tree from an array. Couple others were not that tough either.