Model Test Paper DAA
Model Test Paper DAA
i. Explain the difference between the 0/1 Knapsack Problem and the Fractional
Knapsack Problem.
SECTION B
2. Attempt any three of the following:
a. Explain Merge sort algorithm and sort the following sequence {23, 11, 5, 15, 68,31, 4,
17} using merge sort.
b. What are the various differences in Binomial and Fibonacci Heap? Explain
c. Prove that if the weights on the edge of the connected undirected graph are distinct
then there is a unique Minimum Spanning Tree. Give an example in this regard. Also
discuss Kruskal’s Minimum Spanning Tree in detail.
SECTION C
3. Attempt any one part of the following:
a. Write an algorithm of merge sort and prove its worst time complexity ?
b. Explain algorithm for counting sort. Illustrate the operation of counting sort on the
following array: A={0,1,3,0,3,2,4,5,2,4,6,2,2,3}?
a. Discuss the various cases for insertion of key in red-black tree for given sequence of key
in an empty red-black tree- {15,13,12,16,19,23,5,8}. Also show that a red-black tree with
n internal nodes has height at most 2lg(n+1).
b. Explain B-Tree and its properties. Also write B-Tree deletion cases with example.
b. Explain “greedy algorithm” Write its pseudo code to prove that fractional Knapsack
problem has a greedy-choice property
6. Attempt any one part of the following:
a. Apply Branch and Bound technique to solve travelling salesman problem for the graph
whose cost matrix given below:
Cost matrix:
a. Write and explain the algorithm to solve vertex cover problem using approximation
algorithm.