public static void main(String args[]){
        int input[] = {10,12,20,35,46};
        int freq[] = {34,8,50,21,16};
        OptimalTreeSearch ots = new OptimalTreeSearch();
        System.out.println(ots.minCost(input, freq));
        System.out.println(ots.minCostRec(input, freq));
    }
http://www.geeksforgeeks.org/dynamic-programming-set-24-optimal-binary-search-tree/
src/com/interview/dynamic/OptimalTreeSearch.java