[algo2] Used DP to solve optimal bst problem.