











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












TREE DATA STRUCTURE: ⏩ A tree is a non-linear data structure used to store data in a hierarchical structure. It consists of nodes connected by edges.
TYPES OF TREES:
⏩ A node can have any number of children. ⏩ No restriction on branches.
⏩ A binary tree is a special type of tree where each node has at most two children. ⏩These two children are called: ➡ Left child ➡Right child
⏩A full binary tree is a binary tree in which every node has either 0 or 2 children. ⏩No node has only one child. ⏩Nodes are either leaf nodes (0 children) or internal nodes (2 children).
➡No empty spaces are allowed between nodes in the last level. ➡Efficient for array (sequential) representation. ➡Used in heap data structures.
⏩A perfect binary tree is a binary tree in which: ⏩All internal nodes have exactly 2 children, and ⏩All leaf nodes are at the same level (same depth).
➡A skewed tree is also called a degenerate tree. *⃣ TYPES OF SKEWED BINARY TREE: ➡ 1. LEFT SKEWED TREE: All nodes have only left child. ➡ 2. RIGHT SKEWED TREE: All nodes have only right child.
➡Each node has only one child. ➡Height of the tree = number of nodes. ➡Searching becomes slow (like linear search)
✅ Represents hierarchical relationships. ✅ Efficient searching and sorting. ✅ Flexible structure.
❌ Complex implementation ❌ Requires extra memory
THANK YOU