public class LinkedList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected LinkedNode |
firstNode |
protected LinkedNode |
lastNode |
Constructor and Description |
---|
LinkedList()
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
LinkedNode |
Delete(int index)
Deletes node with given index.
|
LinkedNode |
Delete(TreeNode deleteNode)
Deletes node with given TreeNode.
|
LinkedNode |
FirstNode()
Getter for first node in list.
|
java.lang.Boolean |
Insert(TreeNode treeNode,
int index)
Inserts new new node at given index in linked list.
|
LinkedNode |
LastNode()
Getter for last node in list.
|
LinkedNode |
Retrieve(int index)
Retrieves node from indicated index.
|
protected LinkedNode firstNode
protected LinkedNode lastNode
public LinkedNode FirstNode()
public LinkedNode LastNode()
public LinkedNode Retrieve(int index)
index
- Index of node to retrieve.public java.lang.Boolean Insert(TreeNode treeNode, int index)
treeNode
- TreeNode for node to hold.index
- Index of new node.public LinkedNode Delete(int index)
index
- Index of node to delete.public LinkedNode Delete(TreeNode deleteNode)
deleteNode
- TreeNode to delete.