CSCI 256
Design and analysis of algorithms
Assignment 8

Due Friday, 4/13/2001


Only turn in problems from the second section.

Practice problems:

  1. Problem 34.4-1 on page 875 of the text.

  2. Problem 34.4-5 on page 876 of the text.

  3. On-line string matching algorithm: Suppose that the pattern is input one character at a time at a relatively slow pace, but the text is already given. We would like to proceed with the matching as much as we can, without waiting until all the pattern is known. In other words, just before the kth character is input, we would like to be at the first place in the text that matches the first k-1 characters in the pattern. Modify the KMP algorithm to achieve that goal.

Problems to be turned in:

  1. Implement Kruskal's algorithm. Use the efficient implementation of Union-Find from Assignment 3. The input for the graph will be named graph.dat and have exactly the same format as for Assignment 3. Rules for turning in your program are exactly the same as for Assignment 3. Be sure to include a "run" file if your program runs under UNIX. You may use existing libraries to represent graphs. Here is the version of Kruskal's algorithm handed out in class.

  2. Problem 34.4-3 on page 876 of the text.


Back to:

  • CS256 home page
  • Kim Bruce's home page
  • CS Department home page
  • kim@cs.williams.edu