CSE 205 Lecture Notes - Lecture 18: Iterator, Abstract Data Type, Linked List
Document Summary
Array that store references in a contiguous memory (static data structure: 2. A linked structure where one element refers to another element, anywhere in memory (dynamic data structure: static vs. A reference to the data of the current node: 2. A reference to the next element in the collection: private class node, private object value, private node next, a linked structure has zero or more of these nodes connected, 1. The node instance variable named value is of type object: will allow one linked structure to store a collection of any class objects, 2. It is important to know how to implement a linked list as a programmer. In arraylist, we can access any element by specifying its index in constant time. In linkedlist, we need to go through n/2 elements on average to get to an element o(n) In arraylist, adding or removing an element can take o(n) (o(n/2) on average) because of shifting all elements.