Suffix sum Created 2026-10-20 Updated 2026-11-05
For a finite sequence , its suffix sums are , with . They satisfy , so one backward pass computes all of them in additions.
For , the suffix sums are including the empty suffix. A range sum on is . Thus suffix sums provide the same constant-time range queries as prefix sums, with the accumulation direction reversed.