TheAlgorithms/Go

Binary Indexed Tree (BIT) / Fenwick Tree Data structure

irfansofyana opened this issue · 4 comments

Description

Binary Indexed Tree (BIT) or sometimes people called fenwick tree is a data structure that can be used to efficiently update elements and calculate prefix sums in a table of numbers.

Details: https://en.wikipedia.org/wiki/Fenwick_tree

For new implementation:

  • Problem statement:

We have an array arr[0 . . . n-1] and we have Q queries. In every query we can:
1 Compute the sum of the first i elements.
2 Modify the value of a specified element of the array arr[i] = x where 0 <= i <= n-1.

It can be solved efficiently with Binary indexed tree

I will be happy to work on this issue if it's okay

No need to open issues for missing implementations. Just open a pr and we will review it.

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

This issue was closed because it has been stalled for 7 days with no activity.