COS 226 PROBLEM SET 1


1. [Exercise 2.6]





2. [Exercise 2.38]







3. Which of the following programs from the text are stable: selection (Program 6.2), insertion (Program 6.3), bubblesort (Program 6.4), or shellsort (Program 6.5)?







4. [Exercise 6.44] Give the best values of h and k that you found and a very brief description of why they are best.







5. Suppose that a file is 5-, 11-, and 13- ordered. What is the maximum number of elements that could be to the left of a given element and larger?







Due: in precept on February 9 or 10.

Do your work on this page (use the back if you must)