representing BST in an array