Java Reference
In-Depth Information
A List
Implementation
That Links Data
Chapter
14
Contents
Operations on a Chain of Linked Nodes
Adding a Node at Various Positions
Removing a Node from Various Positions
The Private Method
getNodeAt
Beginning the Implementation
The Data Fields and Constructor
Adding to the End of the List
Adding at a Given Position Within the List
The Methods
isEmpty
and
toArray
Testing the Core Methods
Continuing the Implementation
A Refined Implementation
The Tail Reference
The Efficiency of Using a Chain to Implement the ADT List
Java Class Library: The Class
LinkedList
Prerequisites
Chapter
3
A Bag Implementation That Links Data
Chapter
11
Queue, Deque, and Priority Queue Implementations (partial)
Chapter
12
Lists
Chapter
13
List Implementations That Use Arrays
Objectives
After studying this chapter, you should be able to
•
Describe a linked organization of data
•
Implement the
add
methods of the ADT list by using a linked chain of nodes
•
Test a partially complete implementation of a class