Homework 6
A. Solve P14.10. As in Homework 5C, print the sizes of the intervals that you merge. The netbrat tester is here
B. Implement the following modification to the quicksort algorithm of Special Topic 14.3 that is beneficial when when dealing with data sets that contain many repeated elements. Instead of partitioning as
≤ ≥
(where ≤ denotes the elements that are ≤ the pivot), it is better to partition as
< = >
However, that is tedious to achieve directly. Instead, partition as four regions
= < > =
and then swap the two = regions into the middle.
Complete this file. The netbrat tester is here.
Draft: Just complete the partition method.
C. Solve P15.1 from the PDF in the content area (not your textbook).
Complete this file. The netbrat tester is here.
Draft: Solve the problem by using the remove(int) method. In the final version, you must use an iterator and its remove() method.
Note: Homework 7 Draft is due on Monday, April 2. You can start working on it on Friday, March 23 and finish it on April 2, and still enjoy your spring break :-)