The Node List ADT models a sequence of positions storing elements of some arbitrary type. It establishes a before / after relation between positions.

It has generic methods:

  • size()
  • isEmpty()

We use an argument throughout to indicate the position. Accessor methods:

  • first()
  • last()
  • prev(p)
  • next(p) Update methods:
  • set(p, e): replace the element at with and return the old eleent
  • remove(p): remove and return the element at
  • addFirst(e) and addLast(e)
  • addBefore(p, e) and addAfter(p, e)