Data Structures and Algorithms with Object-Oriented Design Patterns in Python
next up previous index

Array Properties

Program gif defines two properties of Arrays--data and baseIndex. These properties provide the means to inspect the contents of an Array object (using the fget accessor  methods) and the means to modify the contents of an Array object (using the fset accessor  methods).

Clearly, the running times of each of the baseIndex property fget and fset accessors is a constant. Similarly, the running time of the data property fget accessor is also a constant.

   program2805
Program: Array class data and baseIndex properties.


next up previous index

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