Tree
A tree is a datastructure representing nodes connected by edges
Each node can have a maximum of 2 children
The path is the sequence of one node to the other
A leaf is a node without children

Operations
Insertion
Search
Level-order traversal
Level order starts at the root and goes from top to bottom from left to right
Pre-order traversal
first root node, then left subtree, then right subtree

In-order traversal
The output will produce sorted key values in ascending order
First left subtree, then root, then right subtree
Post-order traversal
First left subtree, then right subtree, then root

https://www.tutorialspoint.com/data_structures_algorithms/tree_data_structure.htm
https://www.tutorialspoint.com/data_structures_algorithms/tree_traversal.htm
Last updated
Was this helpful?