Data Structures and Algorithms with Object-Oriented Design Patterns in C#
next up previous contents index

LinkedList Default Constructor

The code for the LinkedList default constructor is given in Program gif. Since the fields head and tail are initially null, the list is empty by default. As a result, the constructor does nothing. The running time of the default constructor is clearly constant. That is, T(n)=O(1).

   program3736
Program: LinkedList default constructor.


next up previous contents index

Bruno Copyright © 2001 by Bruno R. Preiss, P.Eng. All rights reserved.