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

List Elements

 

The definitions of the methods of the LinkedList.Element class are given in Program gif. Altogether, there are three methods--a constructor and two properties.

The constructor simply initializes the field to the provided values. Assigning a value to the list, datum and next fields takes a constant amount of time. Therefore, the running time of the constructor is O(1).

The Datum and Next properties provide get accessor methods that simply return the values of the corresponding fields. Clearly, the running times of each of these methods is O(1).


next up previous contents index

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