k3heap
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
Metadata
Release files for k3heap 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| k3heap-0.1.12.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k3heap-0.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / k3heap-0.1.12.tar.gz
| Download URL | k3heap-0.1.12.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1b2bfe006ff65f27d2bf6e23f49a54ccc24828df7b72455a74b5fc5defda8c5
|
|
BLAKE2b-256 checksum How to use checksums |
8192ad8853e45c2da864a889b57980deca2905f3892b8ff7ec0d78cff1a4721b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / k3heap-0.1.12-py3-none-any.whl
| Download URL | k3heap-0.1.12-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d5e903d3a91db50e7d040ddecac10ba539f32dbfbfe0e08f70043cee8d408dc
|
|
BLAKE2b-256 checksum How to use checksums |
7b1e30460be8e7c8afe0b5b0c7f9a7f1b0073b9c50b4d7cdb277082fac1bf3f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|