Midterm Challenge
Comprehensive Assessment covering Modules 1-6.
Part 1: 70 Multiple Choice Questions (Analysis, Brute Force, Divide & Conquer).
Part 2: 10 Concept Essay Questions.
Part 1: The Gauntlet (70 MCQs)
Part 2: The Concept Vault (Essays)
1. Algorithm Characteristics
Mod 1List and briefly explain the 5 essential characteristics of an algorithm. Distinguish between an Algorithm and a Program.
Difference: An algorithm MUST terminate (Finiteness). A program (like an OS) may run indefinitely (infinite loop).
2. Asymptotic Notations
Mod 2Explain the difference between $O$, $\Omega$, and $\Theta$. Why is $\Theta(n)$ preferred over $O(n)$ when describing an algorithm's exact behavior?
3. Brute Force Sorting
Mod 3Compare Selection Sort and Bubble Sort. Both are $O(n^2)$, but why might Selection Sort be preferred in a system where writing to memory is expensive?
4. DFS vs BFS
Mod 3Describe the data structures used for DFS and BFS. How does the choice of Adjacency Matrix vs. Adjacency List affect their complexity?
Matrix: $O(|V|^2)$ because finding neighbors requires scanning a whole row.
List: $O(|V| + |E|)$ because we only traverse existing edges.
5. Decrease-and-Conquer Types
Mod 4Differentiate between "Decrease by Constant" and "Decrease by Factor". Give one algorithm example for each.
Factor: Reduces size by half (or n/k). Recurrence $T(n) = T(n/2) + 1 \to O(\log n)$. Ex: Binary Search.
6. Topological Sort
Mod 4What condition must a graph satisfy to be topologically sorted? Explain the "Source Removal" method.
7. Master Theorem
Mod 5Given $T(n) = 2T(n/2) + n$, apply the Master Theorem to find the complexity. What algorithm does this recurrence represent?
8. QuickSort Worst Case
Mod 5Under what specific conditions does QuickSort perform in $O(n^2)$? How can we mitigate this?
9. Presorting Benefits
Mod 6"Presorting makes everything faster." Critically evaluate this statement. When is it true, and when is it false?
True if you search many times (amortized cost) or if brute force is $O(n^2)$ (e.g., uniqueness).
False if searching once (Linear search $O(n)$ < Sorting $n \log n$).
10. AVL Rotations
Mod 6What triggers a rotation in an AVL tree? Describe the difference between a Single Rotation and a Double Rotation scenario.
Single: Used for Left-Left or Right-Right imbalance (straight line).
Double: Used for Left-Right or Right-Left imbalance (zig-zag).