Construct a BST from an array