Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jaydattpatel/binary-tree

Different Operation on Binary Tree Structure
https://github.com/jaydattpatel/binary-tree

bfs-search binary-tree breadth-first-search c c-language cplusplus cpp depth-first-search dfs-search inorder-traversal levelorder-traversal online-manipal-bca postorder-traversal preorder-traversal tree-height

Last synced: about 2 months ago
JSON representation

Different Operation on Binary Tree Structure

Awesome Lists containing this project

README

        

# Binary-Tree
Different Operation on Binary Tree Structure


Visitor badge

CREATE BINARY TREE

(1,A)
_______________|________________
| |
(2,B) (3,C)
________|________ ________|________
| | | |
(4,D) (5,E) (6,F) (7,G)
___|___ ___|___ ___|___ ___|___
| | | | | | | |
(8,H) (9,I) (10,J) (11,K) (12,L) (13,M) (14,N) (15,O)


Inorder is: [4, D] [2, B] [5, E] [1, A] [6, F] [3, C] [7, G]

Preorder is: [1, A] [2, B] [4, D] [5, E] [3, C] [6, F] [7, G]

Postorder is: [4, D] [5, E] [2, B] [6, F] [7, G] [3, C] [1, A]

BFS levelorder is: [1, A] [2, B] [3, C] [4, D] [5, E] [6, F] [7, G]

Height of Tree : 3

DFS levelorder is: [4, D] [5, E] [6, F] [7, G] [2, B] [3, C] [1, A]

Print value of level:
Level-1: [1, A]
Level-2: [2, B] [3, C]
Level-3: [4, D] [5, E] [6, F] [7, G]