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

Default Constructor

The code for the default LinkedList<T> constructor is given in Program gif. This routine simply constructs the representation of an empty linked list as shown in Figure gif (b). I.e., both the head and tail pointers are set to zero. The running time of the default constructor is clearly constant. I.e., T(n)=O(1).

   program3546
Program: LinkedList<T> Class Default Constructor Definition


next up previous contents index

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