CSC 311 DATA STRUCTURES ADT LIST //Copyright Dr. Marek A. Suchenek, 2005, 2006, 2007, 2008, 2009 - 2025 public class LIST { public POSITION First() // ex. use: p = L.First(); public POSITION End() // ex. use: p = L.End(); public POSITION Next(POSITION p) // p must not be End // ex. use: p = L.Next(p); public POSITION Previous(POSITION p) // p must not be First // ex. use: p = L.Previous(p); public LIST() // constructor of empty list // ex. use: L = new LIST(); public boolean isEmpty() // ex. use: if (L.isEmpty()) ...; public Object Select(POSITION p) // p must not be End // ex. use: x = L.Select(p); public void Replace(Object x, POSITION p) // p must not be End public void Delete(POSITION p) // p logically advances to next; //p must not be End; saved positions after p not usable public void Insert(Object x, POSITION p) //inserts on p; //saved positions after p not usable } class POSITION { ... public boolean isEqual(POSITION p) // use: if (q.isEqual(p)) ... }