k3heap is a binary min heap implemented with reference
Project description
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
Project details
Release history Release notifications | RSS feed
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.6.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file k3heap-0.1.6.tar.gz
.
File metadata
- Download URL: k3heap-0.1.6.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e483a7a854d8cc833ef95d564820e48bcd6f6bc77648a01b1cfc1c11b03673e0 |
|
MD5 | 01b7edc88df153e9ef9139573fcb18dd |
|
BLAKE2b-256 | 8e06986c402cd40971e1413d696e018fd09dd7a730376f8692206e7ae2162bf3 |
File details
Details for the file k3heap-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: k3heap-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e1e4859d5eae7c56bced926c9d4c27f0ff5e4b955801cb68e53259d900c67ff |
|
MD5 | b3c74d28f501ed40b519944deca14757 |
|
BLAKE2b-256 | 9b00c31a40a6cb43d71161e979b607d4e00c7045eb27644ca12d0ec0f2994da8 |