CSL310 Midterm Winter 2021

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Open Course on Algorithms (CSL 310)

Winter 2021
Maximum Marks: 25
Time: 1 hour
Slot B

1. Let us consider an instance of 0/1 Knapsack problem that we have taken in the
class. The capacity of the knapsack is W = 25 and the items are as shown in the
following table. Solve it using dynamic programming. Give its time complexity.
Trace the exact items that will be taken in the knapsack. (10)

Item A B C D

Profit 24 18 18 10

Weight 24 10 10 7

2. Give the detailed time complexity analysis of heapsort algorithm. (10)

3. What is the lower bound on comparison-based sorting algorithms and why? Are
there better algorithms for sorting which are not comparison based? What is
stable sorting algorithm? Give an example of the same. (3)

4. What do you mean by polynomially larger or smaller in case of asymptotic


analysis? Give example and explain. (2)

You might also like