Fenwick tree (BIT)
Prefix sums, with constant tweaks.
Fenwick noticed that the binary representation of an index encodes a clean partition of [1..n]. The result: a one-array structure that handles point updates and prefix-sum queries in O(log n) using a single bit-twiddle (i &= -i) at each step. Smaller and faster than a segment tree, simpler to implement.
A flat array of n + 1 entries. Each slot covers a range determined by the lowest set bit of its index. Update walks "up" by adding the lowest-bit index; prefix-query walks "down" by subtracting it. Twelve lines of code total.
Online analytics, leaderboards, count-of-events-in-window. Anywhere prefix-sum-with-updates is needed. Notably absent from min/max workloads. Those need a segment tree.
Only invertible aggregates work (the range-sum identity sum(l..r) = prefix(r) − prefix(l-1) requires subtraction). For sum, count, XOR: Fenwick wins on speed, memory, and code length.