Segment Tree in depth

A segment tree is a divide and conquer based data structure used to store information about segments or intervals of some linear data structure (usually an array). It is a height-balanced binary tree where every node corresponds to an interval of the array. Segment tree allows processing interval or range queries in logarithmic time, and is thus used when there is a need to process multiple such queries.

Read this article to understand Segment Tree in depth

Have a doubt or thought? Join the discussion now

This is a companion discussion topic for the original entry at