Skip to main content

A Median Heap in Python

A simple program to take medians using a heap data structure.

What It Does

  • Calculates the median of data in O(1) time.

  • Inserting into the data structure takes O(log n) time in the worst case.

Usage

>>> from MedianHeapPython.medianFinder import MedianFinder
>>> d1 = 1
>>> d2 = 2
>>> d3 = 3
>>> medianCalculator = MedianFinder()
>>> medianCalculator.addData(d1)
>>> medianCalculator.addData(d2)
>>> medianCalculator.addData(d3)
>>> print(medianCalculator.getMedian())  # 2
>>> print()

Metadata

Release files for MedianHeapPython 1.0.6

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

Source distribution (sdist)

Source distribution for MedianHeapPython 1.0.6
File Size Uploaded Provenance Actions
MedianHeapPython-1.0.6.tar.gz 1.7 kB Without provenance Details for MedianHeapPython-1.0.6.tar.gz

Release files / MedianHeapPython-1.0.6.tar.gz

Download URL MedianHeapPython-1.0.6.tar.gz
Size 1.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f9465f911fc5ed6d34d88cf2efc0a2f0d2bf17009378472272e348b8b70ad335
BLAKE2b-256 checksum
How to use checksums
6a07f3a02bdeca5e4a2fd4fe131497c7d31ef9fc2e9e52b1a85dfcf095885a5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

Security for MedianHeapPython 1.0.6

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.

Release history Release notifications | RSS feed

This release

1.0.6 This release

1 release file No provenance

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