1/16
a hierarchical data structure used to organize and represent data in a parent– child relationship. It consists of nodes, where the topmost node is called the root, and every other node can have one or more child nodes.
Tree Representation (N-1)

Basic Terminologies
Parent Node - a node that is an immediate predecessor of another node. Example: C is the parent of F and G.

Child Node
a node that is an immediate successor of another node. Example: D, E and F are children of B.

Root Node
the topmost node in a tree, which does not have a parent. Example:
15 is the root node.

Leaf Node (External Node)
nodes that do not have any children. Example: D, I, J, F, K, H are leaf nodes.

Ancestor
any node on the path from the root to a given node (excluding the node itself).
Example: 4, 2, 1 are ancestors of 7.

Descendant
a node x is a descendant of another node y if y is an ancestor of x. Example: h, d, e are descendants of b.

Sibling
nodes that share the same parent. Example: B and C are siblings, and I and J are siblings.

Internal Nodes
the node which has atleast one child.

Degree
the total number of children of a node has. The highest degree of a node among all the nodes in a tree is called as 'Degree of Tree'

Level of a Node
the number of edges in the path from the root to that node. The root node is at level 0.

Binary Tree
is a special type of tree data structure in which every node can have a maximum of 2 children. One is known as a left child and the other is known as right child.

Strictly Binary Tree
every node can have a maximum of two children. But in strictly binary tree, every node should have exactly two children or none

Strictly binary tree data structure is used to represent mathematical expressions.

Complete Binary Tree
all levels are fully filled except possibly the last, which is filled from left to right.

Balanced Binary Tree
has at most 1 in difference between its left and right subtree heights, for each node in the tree.

Properties of Binary Trees
A binary tree is a special type of tree data structure in which every node can have a maximum of 2 children. One is known as a left child and the other is known as right child.
