Homework Clarifications
[Return to Math 61 Homepage]
Contents
Remember that positive number are (usually) only stored in
one possible format: "sign magnitude." If a binary number begins
with a (sign bit of) zero, it is a positive number and no "flipping"
of bits takes place.
The easiest way to think about storage is to use the subscript
rule (cf. Essentials, sec 3.4, pp 19-20). This rule, when
applied to two-dimensional arrays translates the "column" and "row"
rules into "first subscript varies the fastest" and "last
subscript varies the fastest." When, however, one deals with
higher dimensional arrays, the depiction of storage in terms
of "rows" and "columns" does NOT work, but the subscript rule
continues to work. A presupposition is that one can
correctly list all the possible subscripts of an array in proper
order according to the appropriate rule.
Although contemporary computers usually use bytes as the fundamental
unit of memory storage, and combine several bytes into a "word"
to store variables of different types, for the sake of these problems,
think in terms of "words" which can store either character data, or
integer numbers, or real numbers.
For problem B-2, assume that the array subscripts do begin with
subscript values 0, but that the storage scheme happens to be
the "FORTRAN" order rather than the "C++" order.
Assume the sorting routines as found in Essentials, and in
particular, assume that selection sort (cf., p. 30) is such that
it looks for the largest element at each pass and puts it in the
correct location.
For problem D-5, one can assume a very "naive" average -- the
sum of the best and worst cases divided by two. In actuality, the
accurate average is often difficult to compute, since one needs to
take into account various inputs and various possible locations of
the desired "key."
This page is maintained by Dennis C. Smolarski, S.J.
dsmolarski@scuacc.scu.edu
© Copyright 1998 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 25 April 1998.