Professional Documents
Culture Documents
Barani Institute of Management Sciences: Final-Term Exam Fall-2019
Barani Institute of Management Sciences: Final-Term Exam Fall-2019
In the plan we see that it will take 10 days to prepare the building plan
(A) and 5 days to get it approved (B). Furthermore, we can’t start building until we have selected the contractor
(C). We could construct the shortest path from the start to the end for our plan, but it would be of little value. On
the other hand, if we determined.
Q.1: Construct the binary tree, given two traversal sequences? (6 marks)
inorder = B F G H P R S T W Y Z
preorder = P F B H G S R Y T W Z
Q.2: Sort the following unsorted list using heap sort. (6 marks)
1,5,30,70,80,20,15,100,40,25,7,3,8,33,22
Q.3: Create an AVL tree using the following data entered as a sequential set. Show the balance
factors in the resulting tree. (6 marks)
14 17 11 7 53 4 13 12 8
Q.5: Construct the minimum spanning tree (MST) for the given graph using Kruskal
Algorithm. (6 marks)
PRACTICAL
Q .1: With an ASCII encoding (8 bits per character) the 16-character string "I love Pakistan"
requires 120 bits to send. use Huffman's algorithm to construct a tree that is used for data
compression. Calculate minimum bits of stream using Huffman's algorithm to send the above
string. (10 marks)
Q 2. Write a c++ program for implementation of quick sort algorithm using recursion. 10
Marks