next up previous
Up: APS105 Home

APS 105 -- Computer Fundamentals


Lab #8


Fall, 2000


You must submit this lab by 11:59 pm on Friday, November 17


1. Objective


In this lab, you are required to construct and manipulate a list ADT, which uses a linked list to hold integer numbers.


2. Creating a List ADT


In a file called List.java, write the description for two classes: an Node class and a List class. The Node class will contain an integer number and the next Node in a list. Neither of these classes should use Stdin or print anything.

The List class contains the list ADT operations. You must use use linked lists to implement the list ADT. Lists should be maintained so that the integers are placed in non-decreasing order (note: duplicate values are permitted). The List must contain (at least) the following methods:


In addition to these methods, the class may also contain any fields, methods, or inner classes that you feel are appropriate.


3. Using the List ADT


Write a main method (in a class called Lab8) that uses the List class to perform the following operations. You may write any additional methods you need to help you.


4. FAQ


1.
Typo correction.
mergeFrom() should have return type void.

2.
Deadline extension.
New deadline: Friday at 11:59pm.

3.
How do I do mergeFrom()? Must it be efficient in runtime, or can I call my insert() method?
Do not use your insert() method. You must use references and do pointer manipulation to manually move each Item from the other list to the original one. Do not create any new Items -- anything that does new Item() makes a new item.


5. What to Submit


Submit your Lab8.java and List.java files along with Stdin.java.


Use the command: submitaps105f 8 List.java Lab8.java Stdin.java


next up previous
Up: APS105 Home
Guy G. Lemieux
2000-11-14