树状数组:用最少的代码实现最高效的区间查询从lowbit到LeetCode完整通关指南

1994年,新西兰奥克兰大学的 Peter M. Fenwick 在《Software: Practice and Experience》期刊上发表了一篇题为"A new data structure for cumulative frequency tables"的论文。这篇看似平淡无奇的论文,却发明了一个代码量极小却威力巨大的数据结构——树状数组(Binary Indexed Tree,简称 BIT),也被称为 Fenwick Tree。 ...

10 min · 4551 words