Find the optimal binary search tree based on probabilities of each search key