Skip to content
Previous Year Question Paper

CS/SD-402 (GS) – Analysis Design of Algorithm

June 2025CSESEMESTER-4
June 2025
Max Marks: 70
Duration: 3 Hours
Instructions:

Attempt any five questions.

All questions carry equal marks.

Q.1
a)Unit 1

Solve T(n)=1 for n≤4, T(n)=2T(√n)+log n for n>4 using substitution method.

b)Unit 1

The worst case of merge sort is O(n log n). What is its best case? Can we say merge sort is O(n log n)?

Q.2
a)Unit 2

Obtain optimal Huffman codes for messages with frequencies (4,5,7,8,10,12,20). Draw the decode tree.

b)Unit 2

Use shortest paths algorithm to obtain lengths from vertex 1 to all remaining vertices in the given di-graph.

Q.3
a)Unit 3

Give an example of knapsack instances for which |Sⁱ|=2ⁱ, 0≤i≤n, with one instance for each n.

b)Unit 3

Explain Floyd Warshall algorithm with suitable example.

Q.4
a)Unit 4

Given an n×n chessboard, present an algorithm for Knight's tour problem to visit all squares exactly once.

b)Unit 4

Consider the traveling salesperson instance defined by the given 5×5 cost matrix.

Q.5
a)Unit 5

Show that DFS visits all vertices in G reachable from V.

b)Unit 5

Obtain a nondeterministic algorithm of O(n) to determine if a subset of n numbers sums to m.

Q.6
a)Unit 5

Write an algorithm to delete element x from a BST. What is the time complexity?

b)Unit 5

What do you mean by balance factor in AVL tree? Give example to balance an AVL tree.

Q.7
a)Unit 4

Write an algorithm for n jobs on k parallel processors to minimize finish time.

b)Unit 3

Find optimal solution for 0/1 knapsack: W=(10,15,6,9), P=(2,5,8,1), M=30.

Q.8
Unit 5/3

Write short notes on (any two): a) B-Trees b) Tree Traversal c) Reliability Design.