CSci 161 Lab #6
 

Navigate to the directory where you usually do your Java programming. Create a new folder in this directory named sllist. This folder will contain Java files named Lnode.java and Llist.java. The Lnode.java file will contain the Java definition for a node in a singly-linked list. The Llist.java file will contain the Java definition of a singly-linked list. Copy the files Lnode.java and Llist.java into your sllist folder. The Lnode.java file is complete and you won't need to make any changes to it. The Llist.java file is a template for the work you will do for this lab. It contains a lot of stubs which you will complete. Study these files for a bit to be sure you understand the code they contain. Ask questions if there are things you don't understand.

Also copy the Lab6.java file into your Java programming directory (the same one that contains your newly created sllist folder). This class contains a main routine that can be used to test the code you write. You should be able to compile are run this program as soon as the three files (Lab6.java, Lnode.java and Llist.java) are in the correct locations. Feel free to make modifications to this main routine to increase the strength of your testing.

Implement the missing methods for the Llist class. This includes the isEmpty(), insert(T i), remove(T i) and remove() methods. Note that there are two remove methods which can be distinguished by the parameters they receive. [The remove method has been overloaded.]

 
When you are finished, ask your lab instructor to check your work and record your scores.