A Python implementation of Fenwick trees
Project description
fenwick
A Python library that implements Fenwick trees, based on the algorithm in (Fenwick 1994).
Features
- Update a frequency in O(log n).
- Retrieve a single frequency in O(log n).
- Initialize existing frequencies in O(n).
- Retrieve all frequencies in O(n).
Requirements
fenwick supports Python 2.7 and Python 3.x.
Linux, Mac, and Windows are supported.
Documentation
See documentation.md.
Example Usage
See example.py.
References
Fenwick, Peter M. 1994. “A New Data Structure for Cumulative Frequency Tables.” Software: Practice and Experience 24 (3): 327–36.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size fenwick-0.1.0-py2.py3-none-any.whl (4.4 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size fenwick-0.1.0.tar.gz (4.7 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for fenwick-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 364add7b3fc9ca6433de5a78db58bb10275ecd61bb1c74a5ca978d0fb9194785 |
|
MD5 | ea9d8011664a51478c8e2fafa42e6a68 |
|
BLAKE2-256 | 82ac0418ffb4a19016fad413afa5cdd7d7f851c36abd2c481cefc9fefb3e81b6 |