Created recursive optimal_bst method