name: inverse layout: true class: taylor msoe --- class: center, middle .title[ # LinkedLists ## Lists without an array ] ??? * **P** speaker view * **C** clone slideshow * **?** help --- # LinkedList * Implements the `List<>` interface -- * Does not make use of an array -- * Elements in the list are linked together -- * Each location in the list consists of an element value and a link to the next location location in the list --- # Minimal `List` implementation * We can create a list with as little as one attribute -- * The link to the first location in the list ~~~ Java List
list = new LinkedList<>(); ~~~ ![Empty List](llEmpty.svg) --- # `List<>` with One Element ~~~ Java List
list = new LinkedList<>(); list.add(new Diamond()); ~~~ ![Single Element List](llOne.svg) --- # `List<>` with Two Elements ~~~ Java List
list = new LinkedList<>(); list.add(new Diamond()); list.add(new Diamond(25)); ~~~