Segment Tree | Set 2 (Range Minimum Query) We have introduced segment tree with a simple example in the previous post. In this post, Range Minimum Query problem is discussed as another example where Segment Tree can be used. Following is problem statement. We have an array arr[0 . . . n-1]. We should be able to efficiently find the minimum value from index qs (query start) to qe (query end) where 0 <= qs <= qe <= n-1. The array is static (elements are not deleted and inserted during the series of queries).
Read full article from Segment Tree | Set 2 (Range Minimum Query) | GeeksforGeeks
No comments:
Post a Comment