tutorials

Spring 2007
course
navigation

algorithms exam

Now with more answers!

possible topics

rules

questions

1

Experimentally demonstrate the average big-O behavior of the following two problems, using randomly generated data. In other words, code each in a language of your choice, generate sample problems of different sizes n, collect data on how many steps each takes to accomplish (you can define a "step" in any reasonable way), and plot steps(n) vs n for both problems.

2

For each of the two problems in question 1, explain whether the problem is in the complexity class P, NP, or some other. Be explicit as to why it does or does-not fit all the conditions necessary for membership. Discuss how your experimental results from question 1 fit into this story.

3

You are given a list N names and told that you'll need to search the list for a given name M times. The following techniques are suggested:
a) Discuss the time efficiency of these as N and M vary. Which would you suggest and why?
b) Implement one of these, including tests and docs.
c) Would your answer change if you need to change the list of names by adding and deleting students (P times, say) between searches?

4

Compare and contrast the LZW and Huffman coding methods of lossless data compression, including their strengths, weaknesses. Give an example of each algorithm applied to the same text string. (You can either do this by hand or code it; your choice.)
http://cs.marlboro.edu/ courses/ spring2007/tutorials/ ambrose/ exams/ algorithms
last modified Friday March 16 2007 11:44 pm EDT