CS 112
Lecture and Lab 17
Linked lists in Java
- The Linked List abstract data type.
- The List applet.
- LinkedList class in Java.
- Iterators in Java. Interface vs. class.
- ListIterator
- An example: LinkedList test application. How to document your testing
of a program. How to use script to create a
typescript file.
- Student presentations:
- Programming with exceptions in Java. Mary and Aaron.
- What if there is no next element?
Using NoSuchElementException
Lab: implementing a linked list in Java
- Using the handout as a model, implement a simple application ListTest for testing some of the methods in the
Java LinkedList, ListIterator and NoSuchElementException classes. From paragraph 19.1.
- Using paragraph 19.2. of the handout as a model, implement your own LinkedList class. The implementation in the handout
is a simply linked list. This is what you will do in the lab. For homework, you will extend it to a doubly linked list.
Ileana Streinu