Skip to content

Glossary: Algorithms Beyond the Basics in Go

Fenwick tree

Also written: segment tree, segment trees, Fenwick trees

A compact tree-like structure, stored in a slice, that gives fast range totals while values are being updated. Both queries and updates take O(log n) time.

Where the book teaches it