A Fenwick tree (or binary indexed tree) is a fast data structure for storing and maintaining cumulative frequency tables.