Master Segment Tree construction. Learn how to build the tree recursively from an array, calculating sums or minimums for fast interval querying.