##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Fenwick Trees give O(log n) prefix sums and point updates. Simpler than segment trees for some tasks.
Perfect introduction to BIT for range queries with frequency counting. Teaches the fundamental technique of answering offline range queries with BIT.
What each position stores
Excellent for learning order statistics with BIT - finding k-th element with dynamic insertions/deletions using frequency arrays.
Classic inversion counting that combines frequency calculation with BIT. Teaches non-trivial counting problems using Fenwick trees.
Extends inversion counting to triplets. Teaches how to combine multiple BIT queries for complex counting problems.
Brilliant combination of DP with BIT to find maximum weighted increasing subsequence. Shows how BIT can optimize DP from O(n²) to O(n log n).
Advanced DP + BIT using multiple Fenwick trees to count increasing subsequences of specific lengths. Demonstrates multi-dimensional BIT concepts.
Teaches coordinate compression with BIT for counting subarrays with sum less than threshold. Essential technique for large value ranges.
Counting inversions with huge coordinates (up to 10^9). Masterclass in coordinate compression and offline query processing.
Geometric problem with BIT - counting points with velocity constraints. Shows BIT's versatility beyond simple array operations.
Prefix sum queries with point updates. Great for understanding BIT's search capabilities for finding special positions.
Advanced range update with difference arrays and BIT. Teaches the powerful technique of using BIT for range updates.
Advanced BIT on trees with binary lifting. Combines LCA with BIT for efficient path queries maintaining top-k elements.
The quintessential BIT problem - point updates and range sum queries. Perfect starting point for understanding Fenwick trees.
Classic BIT application for counting inversions. Teaches coordinate compression and efficient counting while processing right-to-left.
Variant of inversion counting where condition is nums[i] > 2*nums[j]. Teaches adapting BIT techniques for modified conditions.
Advanced problem combining prefix sums with BIT to count subarrays in a range. Demonstrates BIT's power for complex counting.
Dynamic frequency counting with BIT - tracks elements less than/greater than current during insertions. Real-world BIT application.
Introduction to 2D BIT with point updates and rectangle sum queries. Essential for multi-dimensional Fenwick tree extensions.
Transforms inequality into counting problem solvable with BIT. Teaches problem transformation and coordinate compression at scale.
Optimizable with BIT to find k-th empty slot efficiently. Teaches using BIT for position tracking via binary search on BIT.