An open API service indexing awesome lists of open source software.

https://github.com/neuodev/trees

In this Repo. I created a Tree class From scratch that has different methods: insert(), find(), traversePreOrder(), traversePostOrder(), traverseInorder, BreathFirstSearch(), hieght(), getMin(), equals(), isBindarySearchTree(), printKthNodeAtDistance() [ print kth node at distance ], isLeaf()
https://github.com/neuodev/trees

Last synced: 3 months ago
JSON representation

In this Repo. I created a Tree class From scratch that has different methods: insert(), find(), traversePreOrder(), traversePostOrder(), traverseInorder, BreathFirstSearch(), hieght(), getMin(), equals(), isBindarySearchTree(), printKthNodeAtDistance() [ print kth node at distance ], isLeaf()

Awesome Lists containing this project

README

          

#### Trees
In this Repo I created a Tree class From scratch that has different
methods:
- insert() -> add new node to the tree
- find(node) -> travers the tree untill finding the node else return null
- traversePreOrder() -> trever the node in Depth first search
- traversePostOrder() -> trever the node in Depth first search
- traverseInorder()-> trever the node in Depth first search
- BreathFirstSearch() -> traverse the tree in Breath first search and print them
- hieght() -> return the height of the tree
- getMin() -> return the smallest value in the tree
- equals() -> compare tow trees for equality
- isBindarySearchTree() -> vlaidate the tree that it is a bindary search tree
- printKthNodeAtDistance() -> print kth node at distance
- isLeaf() -> uitl mehtod to vlaidate that a given node is the last node in the tree or a sub tee

![REES](https://github.com/AhmedIbrahim336/Trees/blob/master/assets/tree.png)
![REES](https://github.com/AhmedIbrahim336/Trees/blob/master/assets/tree-2.png)
![REES](https://github.com/AhmedIbrahim336/Trees/blob/master/assets/tree-3.png)