COMS W3134 Lecture Notes - Lecture 7: Doubly Linked List, Linked List, Dynamic Array
Document Summary
Announcements: hw1 will be graded and up soon. Lecture: what is array list iterator implementation, a class known as a nested class, defined inside of another class. Iterator"s job is to step through sequentially a list with a number of method: hasnext() Check if there is a next element: next() Returns the element currently pointing to and then moves to the next one remove() Remove element that we just moved past: static vs not static tells us what kind of access it has to the classes, non-static tied to underlying data of a particular instance of a class. There is already a remove() method in arraylist class, so here we call that method in this method. Implementation of linkedlists does a doubly linked list with sentinel nodes. Instance variables: node class defined inside class linkedlists, node objects are stand alone, clearing, garbage collecting.