Refactored optimal_bst.go