Formally, the Range Minimum Query Problem is:
Given an array A[0, N-1] , Find the position of the element with the minimum value between any two given indices.
Now, the standard solution is to use a segment tree and has been described here. Another data structure used to solve range queries is the Binary-Indexed Tree (Fenwick Tree), and it is much easier to understand and code.
Can the range minimum query problem be solved by Binary-Indexed-Trees, and how? An implementation of the update and query function would be appreciated.
Despite the other answers it is possible to use Fenwick trees for Range Minimum Queries for any range. I posted a detailed explanation here:
How to adapt Fenwick tree to answer range minimum queries
In short, you need to maintain
i-(i&-i)
i+(i&-i)
To query any range in O(log n)
To update any value in amortized O(log n) you need to update the real array and both trees. Updating a single tree: