Segment Tree

In computer science, a segment tree is a tree data structure for storing intervals, or segments. It allows querying which of the stored segments contain a given point. It is, in principle, a static structure; that is, its content cannot be modified once the structure is built. A similar data structure is the interval tree.

A segment tree for a set I of n intervals uses O(n log n) storage and can be built in O(n log n) time. Segment trees support searching for all the intervals that contain a query point in O(log n + k), k being the number of retrieved intervals or segments.

Applications of the segment tree are in the areas of computational geometry, and geographic information systems.

The segment tree can be generalized to higher dimension spaces as well.

Read more about Segment Tree:  Structure Description, Storage Requirements, Construction, Query, Generalization For Higher Dimensions, Notes, History

Famous quotes containing the word tree:

    But when the bowels of the earth were sought,
    And men her golden entrails did espy,
    This mischief then into the world was brought,
    This framed the mint which coined our misery.
    ...
    And thus began th’exordium of our woes,
    The fatal dumb-show of our misery;
    Here sprang the tree on which our mischief grows,
    The dreary subject of world’s tragedy.
    Michael Drayton (1563–1631)