Saturday, June 11, 2011

Application of Segment Tree A data Structure Which Support Update and Query Operation on Array Intervals in Logarithmic Time

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 :