Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dstein64/fenwick
An implementation of Fenwick trees (Fenwick 1994).
https://github.com/dstein64/fenwick
binary-indexed-tree data-structures fenwick-tree
Last synced: about 2 months ago
JSON representation
An implementation of Fenwick trees (Fenwick 1994).
- Host: GitHub
- URL: https://github.com/dstein64/fenwick
- Owner: dstein64
- License: mit
- Created: 2018-08-03T20:38:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T18:44:16.000Z (2 months ago)
- Last Synced: 2024-10-25T19:40:20.979Z (2 months ago)
- Topics: binary-indexed-tree, data-structures, fenwick-tree
- Language: Python
- Homepage: https://pypi.org/project/fenwick/
- Size: 39.1 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://github.com/dstein64/fenwick/workflows/build/badge.svg
:target: https://github.com/dstein64/fenwick/actionsfenwick
=======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>=3.6``.
Linux, Mac, and Windows are supported.
Installation
------------`fenwick `__ is available on PyPI, the Python Package Index.
::
$ pip install fenwick
Documentation
-------------See `documentation.md `__.
Example Usage
-------------See `example.py `__.
Tests
-----Tests are in `tests/ `__.
::
# Run tests
$ python -m unittest discover tests -vLicense
-------The code in this repository has an `MIT License `__.
See `LICENSE `__.
References
----------Fenwick, Peter M. 1994. “A New Data Structure for Cumulative Frequency Tables.”
Software: Practice and Experience 24 (3): 327–36.