This is the fourth graded lab for CS2102.
If you are in the Lab, perform the routine KH 202 setup or AK 120D setup; for now, ignore the "advanced setup" options. If you would like to set up Eclipse on your personal computer, then (a) install Java JDK 1.5 if you need to as described in tools section (here); and (b) install Eclipse as described in tools section (here).
This example must be handed in to the lab proctors and is a record that you attended the lab.
Given the NumberList above, what is the resulting LinkedList structure after invoking insert(5) and then insert(1)? Draw it out in the same manner as shown above.
Use Eclipse/Sourceforge to update Examples project to
retrieve code files for package nov29. This package contains three classes:
NumberNode, NumberList, and NumberListTest. For this lab, you
must:
The documentation found in the class files should be sufficient to direct you
in your endeavors.
This code is provided within the NumberListTest class. Fill in the designated code to test the operation of insert. You should use assertEquals() and use the result of invoking toString on a NumberList object.
In the insert method, there is a while loop to traverse the list. The guard on the while loop is
Given the set of test cases in NumberListTest, which test case breaks if you had mistakenly used:while (prev != null) {
// body of loop.
}
while (node != null) {
// body of loop.
}
Your goal is to turnin the assignment file(s) (NumberList.java and NumberListTest.java) by November 29th at 11:59 PM. The name of the assignment you should use is "lab4".
Date | Reason/Change |
11/28/2006 | Ready to go |