Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weescottishpuffin/binarytrees
A python 3 module for creating Binary-Tree like datastructures
https://github.com/weescottishpuffin/binarytrees
Last synced: about 1 month ago
JSON representation
A python 3 module for creating Binary-Tree like datastructures
- Host: GitHub
- URL: https://github.com/weescottishpuffin/binarytrees
- Owner: WeeScottishPuffin
- License: mit
- Created: 2023-11-10T08:33:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-10T08:49:46.000Z (about 1 year ago)
- Last Synced: 2024-11-03T08:09:06.724Z (3 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
---This is a simple python module to create and manipulate Binary trees.
## Binary Trees and Nodes
A binary tree object can be created with.
```BinaryTree.BinaryTree(root)```This will create a binary tree with one (root) node. To add nodes, just use ```BinaryTree.appendNode(value)```.
At any time, you can call the ```delete()``` function on a ```Node()``` object to destroy it. This will re-add all other nodes to the tree.
A list of nodes can be accessed with ```BinaryTree.nodes```.
Other functions and attributes include:
### BinaryTree()
- ```appendNode(value)```
- ```printTree()```
- ```sort()```
- ```nodes```
- ```root```
### Node()
- ```delete()```
- ```children```
- ```isLeaf```
- ```left```
- ```level```
- ```parent```
- ```right```
- ```side```
- ```tree```
- ```value```