Page 191 - DCAP407_DATA_STRUCTURE
P. 191
Data Structure
The figure 10.10 shows a mixed graph.
Figure 10.10: Mixed Graph
Construct a graph G for given vertices V = {2, 3, 4, 5} and edges E = {(2, 3), (2, 4), (2, 5), (3,
4), (3, 5), (4, 3), (4, 5)}.
10.2 Types of Trees
There are different kinds of trees and it is important to understand the difference between them. We
will discuss the following types of trees in this section:
1. Binary tree
2. Binary search tree
3. 2-3 tree
4. Huffman tree
10.2.1 Binary Tree
A tree data structure in which every node has a maximum of two child nodes is known as a binary tree.
It is the most commonly used non-linear data structure. A binary tree could either have only a root node
or two disjoint binary trees called the left sub-tree or the right sub-tree. An empty tree could also be a
binary tree.
Figure 10.11: A Binary Tree
184 LOVELY PROFESSIONAL UNIVERSITY