[PRL] Re: [plt-internal] cisco router problem
William D Clinger
will at ccs.neu.edu
Wed Jan 14 19:03:04 EST 2004
Here's a CS U370 assignment for which about half the class turned
in an O(n^2) solution:
http://www.ccs.neu.edu/course/csu370wc/assignment6.txt
The most common O(n^2) solution involved creating a StringIterator
for the first occurrence of each word found in the input, and using
it to read the entire input, counting the number of times the word
occurs. This worked fine on 10-word inputs, but took a long time
when the input was Thucydides' History of the Peloponnesian War.
The program Matthias is investigating contains exactly the same
kind of mistake.
Will
More information about the PRL
mailing list