# Syllabus for CS218 - Midterm I exam

Topics and Sample Questions for Midterm I:

• 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
• 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 ...

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