I ma trying to find the min value of rows in a matrix depending on a queries.
For example:
0 1 2 3
_ _ _ _
0 - |2|1|3|2|
1 - |1|3|5|1|
2 - |5|2|1|4|
3 - |2|4|2|1|
if I was given a query for row 1, from col 1-2 the min is 3. Etc.
I am confused how to recursively call this function based on the left and right boundaries given.
I can create a segment tree but I am unsure how to implement the left and right into it. Could someone guide me to a link of the algorithm at its full (not some nonsense that people try to explain). Right now I cant find a good explanation of the algorithm.