From charlesreid1

Line 29: Line 29:
See Java API for LinkedList class: https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html
See Java API for LinkedList class: https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html


==Single Linked List==
==Code Implementation==


A no-nonsense type-overhead object is defined in IntList.java: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists/IntList.java
===Singly Linked List===


It takes quite a bit of work to get everything functioning correctly - particularly with remove operations.
A basic singly linked list that forces the data type to be an integer is defined in IntList.java: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists/IntList.java


Practice, review the details, document learnings/patterns/mistakes here: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists
It takes quite a bit of work to get everything functioning correctly - particularly with remove operations. None of the difficulty is in the concept. It is all in the details.
 
Practice, review the details, document learning process/patterns/mistakes here: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists
 
===Circular Linked List===
 
A linked list organized in a circular fashion, that can be expanded but that is efficient in its re-use of space.
 
===Doubly Linked List===
 
Implementation of a linked list that stores a reference to a header and trailer node, "bumper nodes" that make the implementation of various algorithms easier.


=Flags=
=Flags=

Revision as of 07:28, 3 June 2017

List Interfaces in Java API

List ADT

The List interface - adding implements List<E> to a class - has quite a few methods that need to be defined. This makes a data collection capable of being treated as a Collections object.

The full list is here: List interface class abstract methods: https://docs.oracle.com/javase/8/docs/api/java/util/List.html

Link to implementations of various Linked Lists on on git.charlesreid1.com: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists

LinkedList ADT

The linked list abstract data type provides the following methods:

  • size
  • isEmpty
  • first
  • last
  • addFirst
  • addLast
  • removeFirst

Furthermore, convenience methods can be added, like:

  • add
  • remove
  • remove(i)
  • removeFirst
  • removeLast

See Java API for LinkedList class: https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html

Code Implementation

Singly Linked List

A basic singly linked list that forces the data type to be an integer is defined in IntList.java: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists/IntList.java

It takes quite a bit of work to get everything functioning correctly - particularly with remove operations. None of the difficulty is in the concept. It is all in the details.

Practice, review the details, document learning process/patterns/mistakes here: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists

Circular Linked List

A linked list organized in a circular fashion, that can be expanded but that is efficient in its re-use of space.

Doubly Linked List

Implementation of a linked list that stores a reference to a header and trailer node, "bumper nodes" that make the implementation of various algorithms easier.

Flags