AVL tree (self-balancing binary search tree) implementation.
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file balancedbstavl-1.0.0.tar.gz.
File metadata
- Download URL: balancedbstavl-1.0.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c13fe3fadc70a2fd87dcbbd8c18153bdb38ed578a82ed4e80d50ce9453cf71b
|
|
| MD5 |
ec4dc5b44adb48547c12ea141caf5fc6
|
|
| BLAKE2b-256 |
f6e77fc47bec624caeaad44e5e07fcf5fc76adf0215205ed5f69aa6091a7350a
|
Provenance
The following attestation bundles were made for balancedbstavl-1.0.0.tar.gz:
Publisher:
pypi-publish.yml on Shinoryo/BalancedBstAvl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
balancedbstavl-1.0.0.tar.gz -
Subject digest:
0c13fe3fadc70a2fd87dcbbd8c18153bdb38ed578a82ed4e80d50ce9453cf71b - Sigstore transparency entry: 976477493
- Sigstore integration time:
-
Permalink:
Shinoryo/BalancedBstAvl@811f7d42e0261c3796847b79723b0abb69a11df5 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Shinoryo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@811f7d42e0261c3796847b79723b0abb69a11df5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file balancedbstavl-1.0.0-py3-none-any.whl.
File metadata
- Download URL: balancedbstavl-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65e512e752f28d21266ccd960e8fe115e2d9b3b74fa4195c620a6986358aebde
|
|
| MD5 |
1eb71824fb0588d39f1396b828e798f1
|
|
| BLAKE2b-256 |
1936af61168f9a8f4fe3cfb02240cdbec7d8e5abd37322d6a34f2c3923f98a29
|
Provenance
The following attestation bundles were made for balancedbstavl-1.0.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on Shinoryo/BalancedBstAvl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
balancedbstavl-1.0.0-py3-none-any.whl -
Subject digest:
65e512e752f28d21266ccd960e8fe115e2d9b3b74fa4195c620a6986358aebde - Sigstore transparency entry: 976477499
- Sigstore integration time:
-
Permalink:
Shinoryo/BalancedBstAvl@811f7d42e0261c3796847b79723b0abb69a11df5 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Shinoryo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@811f7d42e0261c3796847b79723b0abb69a11df5 -
Trigger Event:
release
-
Statement type: