add range minimum query algorithms