Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
The implementation of the StackAsLinkedList class makes use of one field--an instance of the LinkedList class called list. In addition, the StackAsLinkedList class inherits the count field from the AbstractContainer class. This list is used to keep track of the objects in the stack. As a result, there are as many elements in the linked list as there are objects in the stack.