|
Data Structures and Algorithms
with Object-Oriented Design Patterns in Python |
Three LinkedList properties are defined in Program
.
The head and tail properties
provide accessors for the corresponding instance attributes of LinkedList.
The isEmpty property provides an accessor
that returns a bool result
which indicates whether the list is empty.
Clearly, the running time of each accessor is O(1).

Program: LinkedList class properties.