AVL Tree Library
A simple implementation of an AVL tree (self-balancing binary search tree). It stores values associated with keys and performs insertion, deletion, and search operations in $O(\log n)$ time.
Installation
pip install BalancedBstAvl
Usage
from avltree import AVLTree
tree = AVLTree()
tree = tree.set(10, "a")
tree = tree.set(5, "b")
tree = tree.set(15, "c")
print(tree.find(10))
print(tree.get(5))
print(tree.items())
tree = tree.delete(10)
print(tree.items())
Features
- Insert/Update keys:
set(x, value)(inserts if not present, updates if exists) - Delete keys:
delete(x) - Check key existence:
find(x) - Retrieve values:
get(x, default=None) - Traverse:
items()(in ascending key order)
Dependencies
- Runtime: None (Python standard library only)
- Development:
pytestand others (install withpip install -e .[dev])
Supported Environments
- Python 3.9, 3.10, 3.11, 3.12, 3.13
- OS: Windows / macOS / Linux
Development
pip install -e .[dev]
pytest
License
MIT License
Metadata
Release files for BalancedBstAvl 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 | |
|---|---|---|---|
| balancedbstavl-1.0.0.tar.gz | 11.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| balancedbstavl-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / balancedbstavl-1.0.0.tar.gz
| Download URL | balancedbstavl-1.0.0.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c13fe3fadc70a2fd87dcbbd8c18153bdb38ed578a82ed4e80d50ce9453cf71b
|
|
BLAKE2b-256 checksum How to use checksums |
f6e77fc47bec624caeaad44e5e07fcf5fc76adf0215205ed5f69aa6091a7350a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency logRelease files / balancedbstavl-1.0.0-py3-none-any.whl
| Download URL | balancedbstavl-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65e512e752f28d21266ccd960e8fe115e2d9b3b74fa4195c620a6986358aebde
|
|
BLAKE2b-256 checksum How to use checksums |
1936af61168f9a8f4fe3cfb02240cdbec7d8e5abd37322d6a34f2c3923f98a29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency log