BST
Binary Search Tree with console visualization on Java
implemented features:
- add(value) - adding new node with
valueto tree - search(value) - search node with
valuein tree - del(value) - search and delete node with
valuefrom tree - goLeftRootRight() - print nodes value in
left-root-righttree walk - goRootLeftRight() - print nodes value in
root-left-righttree walk - gotLeftRightRoot() - print nodes value in
left-right-roottree walk - draw() - draw colored tree in concole
examples:
<img src=”http://res.cloudinary.com/dzsjwgjii/image/upload/v1474806366/tree1.png” width=300px/>
LeftRootRight: 1 3 4 5 6 7 11 12 13 14 15 16
RootLeftRight: 7 4 3 1 5 6 12 11 14 13 15 16
LeftRightRoot: 1 3 6 5 4 11 13 16 15 14 12 7
<img src=”http://res.cloudinary.com/dzsjwgjii/image/upload/v1474806709/tree2.png” width=300px/>
<img src=”http://res.cloudinary.com/dzsjwgjii/image/upload/v1474806709/tree3.png” width=400px/>