Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Define asymptotic notations (Big-O, Big-Omega, Big-Theta). State the master theorem and use it to solve the recurrences T(n)=3T(n/2)+n and T(n)=2T(n/4)+sqrt(n).

asymptoticrecurrence
2long10 marks

Explain the complexity classes P, NP, NP-Hard and NP-Complete with examples. Discuss how a problem is proved to be NP-Complete using polynomial-time reduction.

np-completenesscomplexity-classes
3long10 marks

Write a dynamic programming algorithm for the 0/1 knapsack problem and solve it for items with weights {2, 3, 4, 5} and values {3, 4, 5, 6} with knapsack capacity W = 5.

dynamic-programmingknapsack
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

Differentiate between Breadth First Search (BFS) and Depth First Search (DFS) with examples and their time complexities.

graphbfs-dfs
5short5 marks

Solve the recurrence relation T(n) = 2T(n/2) + n using the substitution method and the recursion tree method.

recurrencesubstitution
6short5 marks

Explain the job sequencing with deadlines problem and solve it using the greedy approach for a given set of jobs.

greedyjob-scheduling
7short5 marks

Explain the naive string matching algorithm and the Rabin-Karp algorithm with their time complexities.

string-matching
8short5 marks

Write an algorithm for binary search using divide and conquer. Analyze its best-case, worst-case and average-case time complexity.

binary-search
9short5 marks

Explain the randomized quicksort algorithm and analyze its expected time complexity.

quicksort
10short5 marks

Write a greedy algorithm for the fractional knapsack problem and analyze its time complexity.

greedyknapsack
11short5 marks

Find the edit distance between the strings "ARTIFICIAL" and "NATURAL" using dynamic programming.

dynamic-programmingedit-distance
12short5 marks

Write Dijkstra's algorithm to find single-source shortest paths and explain it with an example.

shortest-pathdijkstra