private int getSum(int freq[], int i, int j){
        int sum = 0;
        for(int x = i; x <= j; x++){
            sum += freq[x];
        }
        return sum;
    }
http://www.geeksforgeeks.org/dynamic-programming-set-24-optimal-binary-search-tree/
src/com/interview/dynamic/OptimalTreeSearch.java