Segment Tree


The structure of Segment Tree is a binary tree which each node has two attributes startand enddenote a segment / interval.

_start_and_end_are both integers, they should be assigned in following rules:

  • The root's start _and _end

    is given by buildmethod.

  • The left child of node A has start=A.left, end=(A.left + A.right) / 2

  • The right child of node A has start=(A.left + A.right) / 2 + 1, end=A.right

  • if start _equals to _end, there will be no children for this node.

results matching ""

    No results matching ""