Skip to main content
https://github.com/dstein64/fenwick/workflows/build/badge.svg

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>=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 -v

License

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.

Metadata

Release files for fenwick 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fenwick 0.2.0
File Size Uploaded Provenance Actions
fenwick-0.2.0.tar.gz 5.8 kB Without provenance Details for fenwick-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fenwick 0.2.0
File Interpreter ABI Platform Actions
fenwick-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for fenwick-0.2.0-py2.py3-none-any.whl

Total release size: 10.5 kB

Release files / fenwick-0.2.0.tar.gz

Download URL fenwick-0.2.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
151cb712886b4c4f767a9bd4d1a328e22ff61ec8a4d792de762b1d0ec3da43ac
BLAKE2b-256 checksum
How to use checksums
cec0c1718b78bf8ce0c9f3e109018fd1c7e3e6b9ed192e91f77779671b5e9852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / fenwick-0.2.0-py2.py3-none-any.whl

Download URL fenwick-0.2.0-py2.py3-none-any.whl
Size 4.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
cdbf23efd877bcde8b777af4332dd0b371772ddd072474a0f313ad1394496fa1
BLAKE2b-256 checksum
How to use checksums
143dd82aee46ed001ea8fc61fd9a0524235bedba81fb712f40b9ebf7d2dda52b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for fenwick 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page