pyavl3
A python dictionary alternative implemented with an AVL Tree.
Quick Start
pip install pyavl3
from pyavl3 import AVLTree
a = AVLTree()
a[1] = "Hello"
a[2] = "world!"
print(", ".join(a.values()))
Why?
Python dictionaries are implemented on hashmaps. Hashmaps, besides being awesome, are a balancing act between efficiency and memory utilization. Python's builtin algorithm is solid and probably the correct choice 99 times out 100. Not really a supprise. But, hashmaps suffers from the need to resize and resizing is pretty expensive. For those few cases where resizing large in-memory blocks of sequentional memory is not going to work, AVLTrees might be a better option. Oh, and AVLTrees are effectivly sorted. So, iterators are deterministic and always in order.
This table compairs the runtime characteristics of Hashtables and AVLTrees
| Hashtable | Hashtable(worst case) | AVLTree | AVLTree(worst case) | |
|---|---|---|---|---|
| Space | O(n) | O(n) | O(n) | O(n) |
| Search | O(1) | O(n) | O(logn) | O(logn) |
| Insert | O(1) | O(n) | O(logn) | O(logn) |
| Delete | O(1) | O(n) | O(logn) | O(logn) |
| Resize | O(n) | O(n) | N/A | N/A |
Metadata
Release files for pyavl3 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyavl3-1.0.0.tar.gz | 6.5 kB | Without provenance | Details for pyavl3-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyavl3-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pyavl3-1.0.0-py3-none-any.whl |
Total release size: 14.7 kB
Release files / pyavl3-1.0.0.tar.gz
| Download URL | pyavl3-1.0.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3532746585d2ed997619bdea9e616bd9b449ad12f663dc4092d10f3e3d4901d
|
|
BLAKE2b-256 checksum How to use checksums |
cbf9a48abd1e59f7db5ec6a07615914bbfe87f21a2bc165d61217c1ce859d087
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
|
Release files / pyavl3-1.0.0-py3-none-any.whl
| Download URL | pyavl3-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a56c98839b8141757eea42bdcc2bf9ff8c6299065bb51505e96f063365035659
|
|
BLAKE2b-256 checksum How to use checksums |
779096485005bae96e423f019ce09198402813d76c40e44f0dd8384b8a7b4080
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
|
Security for pyavl3 1.0.0
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.