Fenwick Tree (Binary Indexed Tree)

Binary Indexed Tree BIT

A Fenwick tree, also known as a binary indexed tree (BIT), is a data structure used to efficiently calculate prefix sums in an array and update elements. It allows for point updates (changing a single element's value) and range queries (summing a contiguous segment of the array) in logarithmic time complexity (O(log n)). It’s particularly useful when dealing with frequent updates and queries on large arrays.

Tags

9 connections Built by Tim Jones