Example: ObjectList
class ObjectList {
Node head = null;
Node tail = null;
void insertAtEnd(Object newobj) {
Node newnode = new Node(newobj);
if (tail == null) {
tail = newnode;
} else {
tail.setNext(newnode);
}
if (head == null) {
head = newnode;
}
}
Previous slide
Next slide
Back to first slide
View graphic version