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.13
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.13.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k3heap-0.1.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.4 kB
Release files / k3heap-0.1.13.tar.gz
| Download URL | k3heap-0.1.13.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ceaf9176482cb90d097801790f45fbb951fb8904fbb1ce23bd87d8432a15bad6
|
|
BLAKE2b-256 checksum How to use checksums |
c01afc378325df98295e4ae5185012fe83401da7c030ce77f93079c0e54361a2
|
| 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.13-py3-none-any.whl
| Download URL | k3heap-0.1.13-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12a0976ddd4814e14c96d722a6ddc66d6c6dc992aef19b9a6fd52b3baa2d4b89
|
|
BLAKE2b-256 checksum How to use checksums |
4c0883b007141c0e851dbc6a0976f28b88be9e8626095afb386e2024dcf60d47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|