python-binary-tree
A simple implementation of a binary tree in Python.
Installation
pip install python-binary-tree
Usage
from binary_tree import BinaryTree
from binary_tree import BinaryTreeNode
# Create a binary tree and add nodes
bt = BinaryTree()
# Create nodes with values
root = BinaryTreeNode(0)
node1 = BinaryTreeNode(1)
node2 = BinaryTreeNode(2)
node3 = BinaryTreeNode(3)
node4 = BinaryTreeNode(4)
node5 = BinaryTreeNode(5)
# Add relationships between nodes
root.add_left(node1)
root.add_right(node2)
node1.add_right(node3)
node2.add_right(node4)
node1.add_left(node5)
# Insert nodes into the binary tree
bt.insert(root)
bt.insert(node1)
bt.insert(node2)
bt.draw()
Example Output
Release files for python-binary-tree 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_binary_tree-1.0.2.tar.gz | 20.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_binary_tree-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.6 kB
Release files / python_binary_tree-1.0.2.tar.gz
| Download URL | python_binary_tree-1.0.2.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f19b15f9b93187a40deacec67c0c6e92d1a8295dadc0321f08c1c2be8d547fa
|
|
BLAKE2b-256 checksum How to use checksums |
790590f662ef192934d497cafcc57c9d890cbab1a31ddce58bf53558c90a5ee6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / python_binary_tree-1.0.2-py3-none-any.whl
| Download URL | python_binary_tree-1.0.2-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6e04359b5556cefded838a41b66856f57378c314a520e45eab0764c50b252ac
|
|
BLAKE2b-256 checksum How to use checksums |
aa3369d8c76f56fcfb491f02f351eb18e5b5ad71963e4cc3a1dc9424e740b706
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|