Final Exam (EX3) Review Questions

CS 4521, Fall 2000

Ch. 35 - Line-Sweep Algorithms and Line Intersections

  1. What is the purpose of the X-data structure in a sweepline algorithm? What kind of data structure is it? What kind of entries does it contain? How are the entries ordered?
  2. What is the purpose of the Y-data structure in a sweepline algorithm? What kind of data structure is it?
  3. In the line-sweep algorithm for determining intersections of horizontal and vertical lines, what kind of entries does the Y data structure contain? How are the entries ordered?

Ch. 34 - String Matching

  1. Suppose you have a text string of length n, a pattern string of length m, and an alphabet of size s. How much time does it take to construct a standard finite state machine for finding matches to the pattern in the text? How much time does the finite state machine take to find the matches?
  2. How does the Knuth-Morris-Pratt algorithm modify the finite state machine? What is the effect on the runtimes?

Ch. 16 - Recursive Optimization, Memoization, and Dynamic Programming

  1. Recursive optimization algorithms are often modified to use memoization or converted into dynamic programming algorithms. Why?
  2. What is the difference between memoization and dynamic programming?
  3. What are some trade-offs to consider in deciding between memoization and dynamic programming?
  4. What are some problems that can be solved by memoization or dynamic programming?
  5. Solve the Optimal Binary Search Tree problem with the following frequencies.
    index 0 1 2
    frequency 0.5 0.3 0.2

Ch. 17 - Greedy Algorithms

  1. Describe the greedy algorithm approach to solving an optimization problem.
  2. Give an example where the greedy approach does not yield an optimal solution.

Ch. 36 - NP-Completeness

  1. What is the class P?
  2. What is the class NP?
  3. Is P = NP?
  4. What does it mean when you say that problem A is reducible to problem B?
  5. What is an NP-Complete problem?

Ch. 37 - Approximation Algorithms

  1. What are the most important considerations in deciding between an optimal solution and an approximate solution of an optimization problem?
  2. What algorithm approach often provides useful approximate solutions to an optimization problem?
For the final exam, you should also reread the following: