Tree - C P P
- Tree
- A non-linear data structure
- Node
- Terms
- Edge
- Data
- Child
- Parent
- Siblings
- Ancestor
- Decedent
- Binary Tree
- Every Node can have less than 2 child
- Traversal
- Level Order
- In-order
- Pre-order
- Post-order
- Balanced Binary Tree
- Difference between heights of left and right subtrees is not more than 1 for all nodes of tree
- Complete Binary Tree
- Every level is completely filled except last level
- Nodes always added from the left
- Binary Search Tree
- All Left nodes are smaller and RIght nodes are greater than current node
- In-order of BST is sorted in ascending order
- Minimum value at leftmost part and Maximum value at rightmost part
- Inorder Predecessor and Successor
- The maximum value in left subtree is predecessor
- The minimum value in right subtree is successor