HW1 4 - track of whether or not the client wants you to...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
\ We are suggesting that you develop the program in three stages: 1. For this version, we won't worry about the issue of unique values. We just want a basic version of the class that keeps a list in sorted order and that uses binary search to speed up searching. This stage involves all of the following (not necessarily in this order): a. Copy Anaylntlistjava to Sortedlntlistjava and change all occurrences of Arraylntlist to Sortedlntlist. That way you'll have a new class that has the same behavior as the old Arraylntlist class (including the two constructors). b. Make sure that the two-argument add method to add at an index is no longer a public method. c. Modify the one-argument add method so that it preserves sorted order. You may need to use binary search here as well if your solution involves fwo steps (first locate, then insert). d. Modiff indexOf so
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: track of whether or not the client wants you to guarantee that the list has unique values. Add the two constructors that involve setting unique and modiff add so that it doesn't add duplicates if unique is set to true. 3. Modiff your code to have getUnique and setUnique. Remember that if the client calls setUnique and sets the value to true, you have to eliminate any duplicates that might be in the list. We will be providing testing code for each of these three stages, and for only this program you are allowed to discuss how to write testing code with other students. Keep in mind that these tests are not guaranteed to be exhaustive. They are meant to be examples of the kinds of tests you should perform. In particular, you will want to do a lot of simpler testing before you try rururing any of these high-powered tests that really push the limits. Page 4 of 4...
View Full Document

This note was uploaded on 11/03/2009 for the course CSE 143 taught by Professor Sr during the Spring '08 term at University of Washington.

Ask a homework question - tutors are online