Operations On Binary Tree
Project description
EasyBT
Make Binary trees easy for everyone it is used to serialize-deserialize binary trees and performs much more operations
- Serialize (tree nodes to list )
- Deserialize (list to tree nodes )
- Height (Finds height of the tree) and Diameter (Finds diameter of the tree)
- InOrderTraversal,PostOrderTraversal,PreOrderTraversal
- LevelOrderTraversal
- MirrorTree
- LeafNodes,NumberOfLeafNodes
Installation
Use the package manager pip to install easybt.
pip install easybt
Usage
from easybt.binarytree import BinaryTree
# Create Object
bt=BinaryTree()
# add nodes in list
nums=[1,2,None,None,5,6]
# it will return root node of the tree
root=bt.DesializeTree(nums)
Examples
[1,2,3,4,5,6] [1,2,None,4,5,6]
1 1
/ \ /
2 3 2
/\ / / \
4 5 6 4 5
/
6
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Contributors
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
easybt-0.0.4.tar.gz
(3.6 kB
view hashes)
Built Distribution
easybt-0.0.4-py3-none-any.whl
(4.5 kB
view hashes)