If a BIT handles sums, a segment tree handles everything — sums, minimums, maximums, GCDs, and any associative operation. It's the most versatile range query structure you'll encounter. This post breaks down what segment trees are, how they work under the hood, and why they're the go-to when a BIT or prefix sum isn't flexible enough.