Skip to main content

Binary min heap implemented with reference

Project description

k3heap

Action-CI Build Status Documentation Status Package

k3heap is a binary min heap implemented with reference

k3heap is a component of pykit3 project: a python3 toolkit set.

In this module RefHeap is a binary min heap implemented with reference: a parent has two references to two children and a child has a parent reference to its parent.

RefHeap is not thread safe::

import k3heap

h = k3heap.RefHeap()

x = []
h.push(x)
h.push(x)  # ValueError
h.push([]) # OK

Install

pip install k3heap

Synopsis

import k3heap

h = k3heap.RefHeap([5, 1, 4, 2, 3])

while h.size > 0:
    print(h.pop())

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k3heap-0.1.7.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

k3heap-0.1.7-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file k3heap-0.1.7.tar.gz.

File metadata

  • Download URL: k3heap-0.1.7.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for k3heap-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8c2f5080ba3ae199dc9a334a0f21de30d75430910847a6348f77bace79c7e11a
MD5 d35d8680e236ddc059296faaa53506e2
BLAKE2b-256 ca24ed54855282a47c5bb0d3e62f8d8046c8cf5045d8a8a93495de3bf75a534b

See more details on using hashes here.

File details

Details for the file k3heap-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: k3heap-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for k3heap-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 03c316a8272596316787bfdd0200f6251661c133b80de6cac1f929a16ac34df9
MD5 5e254e81a3ad3c906c8da6d852aec743
BLAKE2b-256 6b700db4f8ea503e7774888a3bf1ede99b4888e3b31e4c0606a6003a70f6af8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page