# Syllabus for CS218 - Midterm II exam

Topics and Sample Questions for Midterm II:

• Concept of worst-case time-complexity
• Asymptotic notations: big-Oh, big-Theta, big-Omega and their properties
• prove or disprove that the following function is big-Oh, big-Theta, big-Omega of ...
• Worst-case analysis of (purely) iterative code
• Lower bound on comparison-based sorting
• Deriving and solving recurrence relations
• derive a recurrence relation from the following pseudo-code ...
• solve the following recurrence relation by iterative substitution ...
• solve the following recurrence relation by Master Theorem ...
• prove by induction the correctness of the solution of the following recurrence relation ...
• Amortized analysis
• Derive a upper bound for the total work required for the following sequence of n operations ...
• String Matching (Brute force, KMP, tries, suffix tries)
• questions on the algorithms/data structures mentioned in parenthesis (or about the corresponding problems)
• design an efficient algorithm that determines whether a string x ...
• KMP: compute the failure function on the following string ...
• compute the suffix trie of the following string ...
• Greedy method (activity selection, fractional knapsack, Huffman coding, Dijkstra, Prim, Kruskal)
• questions on the algorithms mentioned in parenthesis (or about the corresponding problems)
• build the optimal huffman tree for the following string ...
• run Dijkstra algorithm on the following graph ...
• run Kruskal algorithm on the following graph ...
• run Prim algorithm on the following graph ...
• devise a greedy algorithm for the following problem ...
• prove that the following algorithm has the greedy-choice property ...
• prove that the following problem has the optimal substructure property ...
• show why greedy is a bad choice for the following problem ...
• Union-Find
• run the following set of operations (Make-Set, Find-Set, Union) using both union by rank and path compression. Show the final trees ...
• prove the following property about Union-Find ...
• Divide and Conquer method (linear time selection, Karatsuba's integer multiplication, Strassen's matrix multiplication, polynomial multiplication and FFT, FFT-based integer multiplication)
• questions on the algorithms mentioned in parenthesis (or about the corresponding problems)
• questions on the complex roots of unity and their properties
• devise a divide and conquer algorithm for the following problem ...
• Dynamic Programming method (01-knapsack, LCS, matrix chain product, Bellman-Ford, Floyd-Warshall)
• questions on the algorithms mentioned in parenthesis (or about the corresponding problems)
• devise a dynamic programming algorithm for the following problem ...
• compute the maximum profit for the following 01-knapsack assignment ...
• compute the longest common subsequence for the following two strings ...
• run Bellman-Ford algorithm on the following (small) graph ...
• run Floyd-Warshall algorithm on the following (very small) graph ...
• given the final table for a dynamic programming algorithm, trace back all the optimal solutions...

NOTE: The list above is representative of the problems that could be on the exam, but not necessarly exhaustive