Implement construct-optimal-bst