Objective:
This labs objective is to gain experience in using object references to do linking.
The lab assignment:
In this lab you are to implement a sorted list with the doubly linked technique. You are required to use the following DLNode class.
public class DLNode {
double data;
DLNode Prev= null, Next=null;
}
- Download instructors SortedList.java, DLNode.class and lab04.class.
- Complete program SortedList.java by implementing the following methods.
- insert(double n) Insert double precision number n into the sorted list.
- listAscending() List all numbers of the list in ascending order.
- listDescending() List all numbers of the list in descending order.
- Compile SortedList.java and run lab04.class.
- Try the instructors sample program lab04.class in directory ~wang/sample20/lab04 for sample output.
Reviews
There are no reviews yet.