YUNOVA · Data Structures & Algorithms · Module 13: Advanced data structures

Fenwick tree (Binary Indexed Tree)

Notes for offline study · 30 November 2026

Fenwick tree (Binary Indexed Tree)

Key points

  • A Fenwick tree supports prefix sums and point updates in O(log n).
  • It moves through indices using i & -i, the lowest set bit.
  • A range sum is prefix(r) - prefix(l - 1).

Free on YUNOVA · yunova.in · Sign in to add your own lesson notes to this sheet.