http://hackage.haskell.org/cgi-bin/hackage-scripts/package/rangemin efficiently (in effectively linear lazy preprocessing time) processes an array to find minimum elements of subranges of the array in constant time.
--
Louis Wasserman
wasserman.louis@gmail.com