Introduction of binary tree in data structure
Introduction To Binary Trees A binary tree is a hierarchical data structure in which each node has at most two children generally referred as left child and right child. Each node contains three components: Pointer to left subtree Pointer to right subtree Data element The topmost node in the tree is called the root. An empty tree is represented by NULL pointer. A representation of binary tree is shown: Common Terminologies Root: Topmost node in a tree. Parent: Every node (excluding a root) in a tree is connected by a directed edge from exactly one other node. This node is called a parent. Child: A node directly connected to another node when moving away from the root. Leaf/External node: Node with no children. Internal node: Node with atleast one children. Depth of a node: Number of edges from root to the node. Height of a node: Number of edges from the node to the deepest leaf. Height of the tree is the height of the root. In the above binary