Binary Indexed Tree
1 problems · 0 with full explanations
0 Easy0 Medium0 Hard
A Fenwick tree (BIT) answers prefix-sum queries and point updates in O(log n) with O(n) space — simpler to implement than a segment tree. Index arithmetic uses i += i & (-i) to traverse. Use for inversion counting, order statistics, and frequency prefix sums.
How to practice
To practice Binary Indexed Tree problems effectively, start with the Easy problems listed below, trace through each solution on paper, then re-implement without looking. When you can recognise the binary indexed tree pattern within 30 seconds of reading a new problem, move on to Medium difficulty. Use the related topic pages and our study guide for a structured progression.