https://github.com/dimitrisjim/bit
Binary Indexed (Fenwick) Trees
https://github.com/dimitrisjim/bit
binary-indexed-tree fenwick-trees
Last synced: 2 months ago
JSON representation
Binary Indexed (Fenwick) Trees
- Host: GitHub
- URL: https://github.com/dimitrisjim/bit
- Owner: DimitrisJim
- License: unlicense
- Created: 2021-01-31T09:44:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-28T20:54:03.000Z (about 4 years ago)
- Last Synced: 2025-01-25T10:28:23.380Z (4 months ago)
- Topics: binary-indexed-tree, fenwick-trees
- Language: Python
- Homepage:
- Size: 140 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BIT
Binary Index Tree. WIP.
## Operations:
Link plots create from running `python stats`, describe why we see `O(N)` and `O(logN)` ops. TODO: Add these in docs somewhere.
### Initialization:
(or, `BIT.create`) O(N) Operation.
##### Getting the original layout:
##### Appending an item:
##### Updating an items original value:
##### Replacing an items original value:
##### Getting an item (prefix sum):
##### Popping an item:
##### Range Sum
### Plots:
Linear complexity (create, layout)
![]()
![]()
Logarithmic complexity (append, update, setitem, getitem)
![]()
![]()
![]()
![]()