Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
Program defines three properties of DynamicArrays--Data, BaseIndex, and Length. These properties provide the means to inspect the contents of a DynamicArray object (using the get accessor methods) and the means to modify the contents of a DynamicArray object (using the set accessor methods).
Clearly, the running times of each of the BaseIndex property get and set accessors is a constant. Similarly, the running time of the Length property set accessor is also a constant.
Program: DynamicArray properties.