public class LinkedList<E>
extends java.lang.Object
LinkedListItr
Constructor and Description |
---|
LinkedList()
Construct the list
|
Modifier and Type | Method and Description |
---|---|
LinkedListItr<E> |
find(E x)
Return iterator corresponding to the first node containing an item.
|
LinkedListItr<E> |
findPrevious(E x)
Return iterator prior to the first node containing an item.
|
LinkedListItr<E> |
first()
Return an iterator representing the first node in the list.
|
void |
insert(E x,
LinkedListItr<E> p)
Insert after p.
|
boolean |
isEmpty()
Test if the list is logically empty.
|
static void |
main(java.lang.String[] args) |
void |
makeEmpty()
Make the list logically empty.
|
void |
remove(E x)
Remove the first occurrence of an item.
|
LinkedListItr<E> |
zeroth()
Return an iterator representing the header node.
|
public boolean isEmpty()
public void makeEmpty()
public LinkedListItr<E> zeroth()
public LinkedListItr<E> first()
public void insert(E x, LinkedListItr<E> p)
x
- the item to insert.p
- the position prior to the newly inserted item.public LinkedListItr<E> find(E x)
x
- the item to search for.public LinkedListItr<E> findPrevious(E x)
x
- the item to search for.public void remove(E x)
x
- the item to remove.public static void main(java.lang.String[] args)