Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

BARANI INSTITUTE OF MANAGEMENT SCIENCES

Final-Term Exam Fall-2019


Course Title: Data Structure and Algorithms Course Code: CS- CS-443
Discipline /Program:BSCS/BSIT Total Marks:30
Time allowed:2:30 Hour Instructor’s Name: sir iftikhar+MS

Note: Attempt all questions.


One of the tools used to manage large projects is known as the critical path method (CPM). In
CPM the manager builds a network of all phases of a project and then evaluates the network
to determine critical aspects of the project.
In a CPM network, each vertex is an event, such as the start or completion of a task. The arcs
connecting the vertices represent the duration of the activity. Unlike the examples in the text,
they also store the name of the activity. To better understand the concept, let’s look at a
possible CPM plan to build a house. The network for this project is shown in Figure.

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

Draw the tree T.

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.4: Make a Tower of Hanoi Puzzle Game using 4 disks. (6 marks)

Q.5: Construct the minimum spanning tree (MST) for the given graph using Kruskal
Algorithm. (6 marks)

BARANI INSTITUTE OF MANAGEMENT SCIENCES

Final-Term FALL- Exam 2019


Course Title: Data Structure and Algorithms Course Code: CS-443
Discipline / Program: BSCS/BSIT Total Marks:20
Time allowed:30 Minutes Instructor’s Name: sir iftikhar

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

You might also like