A binary search tree implemented for learning purposes.
Project description
bst
In school, I struggled with how binary search trees (and related data structures & algorithms) work, but now with a little more programming experience under my belt I decided to work through implementing one. It currently has insert, search, and traversal functionality.
Install
pip install bst
Usage
from bst import BST
bst = BST()
bst.insert(5)
node = bst.search(5) # <bst.Node object at 0x1060964e0>
node.value # 5
Development
The only dependency is nose
, it's used to automatically run all of the unit tests in tests/
. Install dependencies with pip install -r requirements.txt
, and run the tests with nosetests -v
.
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
bst-0.5.0.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file bst-0.5.0.tar.gz
.
File metadata
- Download URL: bst-0.5.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20667aa6c5ff7c2f42a1ef45aac54038fa9334ba6309ade34849edd96d09506f |
|
MD5 | ab5af36c618c8cdff9f62287540a7c10 |
|
BLAKE2b-256 | 6ad0e4da94fd720dabd1d03f1b718c9710a00b594c68a718e810f97d7eda6fda |
File details
Details for the file bst-0.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: bst-0.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8c351251eebca2ad03b7544ee7ef8c12816ec672f2611bff897d02aa1da64da |
|
MD5 | bdd0a0a65e708c96b8994a92c8e02e6c |
|
BLAKE2b-256 | b266065e339b36d1b885c468ed2ef74e1dced44cfe4b215f85d6b4957fd52c1e |