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

Instance Attributes

The OrderedListAsArray class comprises one instance attribute, _array, which is an array of objects. In addition, the OrderedListAsArray class inherits the instance attribute _count from Container. The _array variable is used to hold the items in the ordered list. Specifically, the items in the list are stored in array positions 0, 1, ..., tex2html_wrap_inline60683. In an ordered list the position of an item is significant. The item at position 0 is the first item in the list; the item at position tex2html_wrap_inline60683, the last.

An item at position i+1 is the successor  of the one at position i. That is, the one at i+1 follows or comes after the one at i. Similarly, an item a position i is the predecessor  of the one at position i+1; the one at position i is said to precede or to come before the one at i+1.


next up previous index

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