public int rangeMinimumQuery(int low, int high) {
        int l = high - low + 1;
        int k = log2(l);
        if (input[sparse[low][k]] <= input[sparse[low + l - (1<<k)][k]]) {
            return input[sparse[low][k]];
        } else {
            return input[sparse[high - (1<<k) + 1][k]];
        }
    }
Date 04/28/2016
@author Tushar Roy

Find range minimum query using sparse table.

Preprocessing Time complexity O(nlogn)
Query Time complexity O(1)
Space complexity O(nlogn)

Reference -
https://www.topcoder.com/community/data-science/data-science-tutorials/range-minimum-query-and-lowest-common-ancestor/
src/com/interview/misc/SparseTableRangeMinimumQuery.java