Unit 1: Analysis of Algorithms and Divide-and-Conquer - Subjective Questions

CSE408 — Design And Analysis Of Algorithms • Practice Questions with Detailed Answers

20 questions

1

Define time complexity and space complexity of an algorithm. Explain why both are expressed as functions of input size.

2

Explain the asymptotic notations , , and . How do they differ from one another?

3

Derive the best-case, average-case, and worst-case time complexities of Insertion Sort. Also state its auxiliary space complexity.

4

Analyze the time and space complexities of Merge Sort by forming and solving its recurrence relation.

5

Compare Insertion Sort and Merge Sort with respect to time complexity, space usage, stability, and suitable applications.

6

Describe a systematic method for analyzing the time complexity of an iterative algorithm. Illustrate it using a loop whose control variable doubles in every iteration.

7

Determine the time complexity of the following nested-loop pattern and justify your answer using summation:

for i = 1 to n:
    j = 1
    while j <= i:
        perform constant-time work
        j = 2 * j
8

Explain how recursive algorithms are analyzed using recurrence relations. Form the recurrence for binary search and solve it.

9

Use the substitution method to prove that the recurrence has the solution .

10

Solve the recurrence using repeated substitution. What kind of recursive algorithm can produce such a recurrence?

11

Solve using the recursion tree method. Explain the cost at each level and the height of the tree.

12

State and explain the three cases of the Master Method for recurrences of the form .

13

Apply the Master Method to solve the following recurrences: (a) , (b) , and (c) .

14

Discuss the limitations of the Master Method. Give examples of recurrences to which it cannot be directly applied.

15

Explain the divide-and-conquer strategy. Identify its three main phases and derive its general recurrence relation.

16

Describe Strassen's Matrix Multiplication algorithm. Write its seven products, show how the result quadrants are obtained, and analyze its complexity.

17

What are order statistics? Define the minimum, maximum, median, and -th order statistic, and compare sorting-based and selection-based approaches.

18

Describe the Quick Select algorithm for finding the -th smallest element. Demonstrate its operation on the array for .

19

Analyze the best-case, expected-case, and worst-case time complexities of Quick Select. How does randomized pivot selection improve its behavior?

20

Explain how to find the -th largest element using a -th smallest selection algorithm. Compare Quick Select with heap-based methods for this task.