Task 6.1 - Singly Linked List

To introduce the second part of the lab classes on writing your own data structures we implement a singly linked list:
  • The list should contain integers, but note that in principle the list contents can be arbitrary (this can be realised via generics in Java, but we do not explore this further here).
  • There should be methods to add, remove, search and print the elements of the list and a method to check whether the list is empty.

The attached archive contains an empty singly linked list class and a simple test program to get your started and test your implementation.