II. Notes on Data Structuring * - Cornell University
II. Notes on Data Structuring * - Cornell University
II. Notes on Data Structuring * - Cornell University
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
NOTES ON DATA STRUCTURING 131<br />
little problem for representati<strong>on</strong> and manipulati<strong>on</strong> <strong>on</strong> modern digital com-<br />
puters. Furthermore, they provide the essential basis <strong>on</strong> which all other more<br />
advanced structures are built.<br />
The most important distincti<strong>on</strong> between elementary structured types and<br />
types of advanced structure is that in the former case the cardinality of the<br />
type is strictly finite, provided that the cardinality of the c<strong>on</strong>stituent types is.<br />
The distincti<strong>on</strong> between a finite and an infinite set is <strong>on</strong>e of profound mathe-<br />
matical significance, and it has many c<strong>on</strong>sequences relating to methods of<br />
representati<strong>on</strong> and manipulati<strong>on</strong>.<br />
(1) Since the number of potential values of the type may be infinite, the<br />
amount of storage allocated to hold a value of an advanced structure is not<br />
determinable from the declarati<strong>on</strong> itself. It is normally <strong>on</strong>ly determined<br />
when the program is actually running, and in many cases, varies during the<br />
executi<strong>on</strong> of the program. In the case of an elementary structure, the number<br />
of different potential values is finite, and the maximum amount of storage<br />
required to hold any value is fixed and determinable from the form of the<br />
declarati<strong>on</strong>.<br />
(2) When the size of a structured value is fairly large, it is more efficient<br />
to update individual comp<strong>on</strong>ents of the structure separately, rather than to<br />
assign a fresh value to the entire structure. Even for elementary types, it<br />
has been found sometimes more efficient to perform selective updating,<br />
particularly for unpacked representati<strong>on</strong>s of Cartesian products and for<br />
arrays. The increased efficiency of selective updating is usually even more<br />
pr<strong>on</strong>ounced in the case of advanced data structures.<br />
(3) Advanced data structures, whose size varies dynamically, require some<br />
scheme of dynamic storage allocati<strong>on</strong> and relinquishment. The units of<br />
storage which are required are usually linked together by pointers, sometimes<br />
known as references or addresses; and their release is accomplished either by<br />
explicitly programmed operati<strong>on</strong>s, or by some form of general garbage<br />
collecti<strong>on</strong>. The use of dynamic storage allocati<strong>on</strong> and pointers leads to a<br />
significant complexity of processing, and the problems can be particularly<br />
severe when the data has to be transferred between the main and backing<br />
store of a computer. No problems of this kind need arise in the case of<br />
elementary data structures.<br />
(4) The choice of a suitable representati<strong>on</strong> for an advanced data structure<br />
is often far more difficult than for an elementary structure; the efficiency of<br />
the various primitive operati<strong>on</strong>s depends critically <strong>on</strong> the choice of repre-<br />
sentati<strong>on</strong>, and therefore a sensible choice of representati<strong>on</strong> requires a<br />
knowledge of the relative frequency with which these operati<strong>on</strong>s will be<br />
invoked. This knowledge is especially important when a part or all of the<br />
structure is held <strong>on</strong> a backing store; and in this case, the choice of repre-<br />
i