daa 22-23
daa 22-23
daa 22-23
General Instructions:
IMP: Verify that you have received question paper with correct course, code, branch etc.
1. This Question paper comprises of three Sections -A, B, & C. It consists of Multiple Choice Questions
(MCQ’s) & Subjective type questions.
2. Maximum marks for each question are indicated on right hand side of each question.
3. Illustrate your answers with neat sketches wherever necessary.
4. Assume suitable data if necessary.
5. Preferably, write the answers in sequential order.
6. No sheet should be left blank. Any written material after a blank sheet will not be evaluated/checked.
SECTION – A 20
1. Attempt all parts:-
1-a. The worst case runtime of linear search(recursive) algorithm (CO1) 1
a) O(n)
b) O(logn)
c) O(n2)
d) O(nx)
1-b. The recurrence relation for the linear search recursive algorithm (CO1) 1
a)T(n-2)+c
b) 2T(n-1)+c
c) T(n-1)+c
d) T(n+1)+c
1-c. Which of the following is the most widely used external memory data structure? 1
(CO2)
a)AVL Tree
b) B-Tree
c) Red Blac Tree
d) Binomial Heap
1-d. What are the operations that could be performed in O(log n) time complexity by red- 1
black tree? (CO2)
a) insertion
b) deletion,
Page 1 of 4
c) finding predecessor
d) All
1-e. Which of the following sorting algorithm is stable? (CO3) 1
a) Selection sort
b) Quick sort
c) Binary insertion sort
d) Heap sort
1-f. Worst case of quick sort is? (CO3) 1
a)Elements are sorted
b) Elements are sorted in reverse order
c) Elements are random order sorted
d) Elements are unsorted
1-g. The Data structure used in standard implementation of Breadth First Search is(CO4) 1
a) Stack
b) Queue
c) Linked List
d) Tree
1-h. In Depth First Search, how many times a node is visited? (CO4) 1
a) Once
b) Twice
c) Equivalent to number of indegree of the node
d) Thrice
1-i. Basic principle in Rabin Karp algorithm? (CO5) 1
a)Hashing
b) Sorting
c) Augmenting
d) Dynamic programming
1-j. Which of the following are the examples of NP-complete Problem (CO5) 1
a) Knapsack problem
b) Hamiltonian path problem.
c) Subset sum problem
d) All above
2. Attempt all parts:-
2.a. List the fundamental steps involved in algorithmic problem solving? 2
(CO1)
2.b. Define binomial heap. (CO2) 2
2.c. Briefly explain the Prim’s algorithm (CO3) 2
2.d. Define principle of optimality (CO4) 2
2.e. Define P, NP and NP Complete in decision problem (CO5) 2
SECTION – B
3. Answer any five of the following-
3-a. Explain the concepts of Counting sort and analyse its complexity with suitable 6
example.(CO1)
3-b. Discuss Insertion sort algorithm and analyse it with an example.(CO1) 6
Page 2 of 4
3-c. Insert the nodes 15 , 13 , 12 , 16 , 19 , 23 , 5 , 8 in empty Red Black tree and 6
delete in the reverse order of insertion.(CO2)
3-d. Discuss the union operation of Binomial heap with an example. (CO2) 6
3-e. Consider following instance for simple knapsack problem. Find the solution using 6
greedy method. (CO3)
N=8
P= {11,21,31,33,43,53,55,65}
W= {1,11,21,23,33,43,45,55}
M=110
3-f. What is backtracking ? Write general iterative algorithm for backtracking. (CO4) 6
3-g. What is travelling salesman problem? Find the solution of following travelling 6
salesman. (CO5)
Cost matrix =
∞ 20 30 10 11
15 ∞ 16 4 2
3 5 ∞ 2 4
19 6 18 ∞ 3
16 4 7 16 ∞
SECTION – C
4. Answer any one of the following-
4-a. What is heap sort? Apply heap sort algorithm for sorting 1,2,3,4,5,6, 7,8,9, 10. 10
Also deduce time complexity of heap sort.(CO1)
4-b. Solve the given recurrence T(n)= 4T(n/4)+n . Explain the Growth of an functions 10
with an example.(CO1)
5. Answer any one of the following-
5-a. Explain insertion in Red Black Tree. Show steps for inserting 1, 2, 3. 4, 5, 6, 7, 8 10
,9 into empty RB tree.(CO2)
5-b. Discuss the Fibonacci heap extract min operation on given example. ( CO2) 10
Page 3 of 4
7-b. Write an algorithm for solving n-queen problem. Show the solution of 4 queen 10
problem using backtracking approach.(CO4)
8. Answer any one of the following-
8-a. Prove the three coloring problem is NP Complete. 10
(CO5)
8-b. What is string matching algorithm? Explain Rabin-Karp method with 10
examples.(CO5)
Page 4 of 4