|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object LLNode
public abstract class LLNode
Class that represents a node in a linked list
Constructor Summary | |
---|---|
LLNode()
Constructor for LLNode that just sets next to null |
Method Summary | |
---|---|
void |
add(LLNode node)
Add the passed node after the last node in this list. |
int |
count()
Return the number of the elements in the list |
LLNode |
getNext()
Method to get the next element |
void |
insertAfter(LLNode node)
Insert the input node after this node. |
LLNode |
last()
Return the last element in the list |
void |
remove(LLNode node)
Method to remove a node from the list, fixing the next links appropriately. |
LLNode |
reverse()
Reverse the list starting at this, and return the last element of the list. |
LLNode |
reverse2()
Reverse2: Push all the elements on the stack, then pop all the elements off the stack. |
void |
setNext(LLNode nextOne)
Method to set the next element |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LLNode()
Method Detail |
---|
public void setNext(LLNode nextOne)
nextOne
- the element to set as nextpublic LLNode getNext()
public void remove(LLNode node)
node
- the element to remove from the list.public void insertAfter(LLNode node)
node
- element to insert after this.public LLNode last()
public int count()
public void add(LLNode node)
node
- the element to insert after this.public LLNode reverse()
public LLNode reverse2()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |