Trees is a very important Data structure used to tackle and get solutions to various problems. It is a non linear data structure unlike queues,stacks and linked lists. Trees can be visualized in a hierarchy fashion. The basic important attributes of a tree are:
- Node
- Root
- Children
- Parent
- Siblings
- Ancestors
- Descendant
- Leaf
- Levels of a tree
- Sub-trees
The most important type of tree is the Binary tree and a lot of problems can be solved using this type of Tree. A BINARY TREE basically is a tree in which all the nodes have at max 2 children meaning, every node might have no child, 1 child or 2 children and not more than 2 children.