Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 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
2long10 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
3long10 marks

Explain the divide and conquer strategy of algorithm design. Write the merge sort algorithm, trace it on the array [38, 27, 43, 3, 9, 82, 10] and analyze its time complexity using the recurrence relation.

divide-and-conquermerge-sort
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

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

greedyjob-scheduling
5short5 marks

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

string-matching
6short5 marks

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

binary-search
7short5 marks

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

quicksort
8short5 marks

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

greedyknapsack
9short5 marks

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

dynamic-programmingedit-distance
10short5 marks

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

shortest-pathdijkstra
11short5 marks

Explain the matrix chain multiplication problem and write its dynamic programming formulation.

dynamic-programmingmatrix-chain
12short5 marks

Explain heap sort algorithm with an example and analyze its time complexity.

sortingheap