public void append(E value) {
if (value == null) {
// we do not want to add null elements to the list.
throw new NullPointerException("Cannot add null element to the list");
}
// head.next points to the last element;
head.next = new Node<E>(value, head);
size++;
}
This implementation of append function is not correct for circular list.
This implementation of append function is not correct for circular list.