Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
Program gives the code for the Purge method of the LinkedList class. The purpose of this method is to discard the current list contents and to make the list empty again. Clearly, the running time of Purge is O(1).
Program: LinkedList class Purge method.