A segment tree is a heap-like data structure that can be used for making update/query operations upon array intervals in logarithmical time. We define the segment tree for the interval [i, j] in the following recursive manner:
the first node will hold the information for the interval [i, j]
if i
See the picture below to understand more :
No comments :
Post a Comment