CISC 280 review sheet for first midterm exam
Exam covers Chapter 1 and chapter 2, thru section 2.2.1.
Excluded are last paragraph (page 16) of section 1.1.5 and
sections 1.3.3 and 2.1.3. The only thing you are required to
know about RSA encryption is that encryption/decryption needs
an efficient expmod function and that key creation needs an
efficient primality test function, i.e. fast-prime?.
sample question types
- A problem similar to exercise 1.1,
i.e. "Evaluate this, this, and this expression."
- Evaluate calls to functions which are defined in the question.
For example, there are four definitions of a function named f on page 58 and 59.
Be sure you can evaluate (f 0 0), (f 0 1), (f 1 0), and (f 1 1) for each of
the 4 forms of definition.
- Problems meant to show you know the special forms. For example, you
find that a certain implementation of Scheme is lacking "cond". Redefine the
following procedure using "if".
(define (foobar x y)
(cond ((= x y) 12)
((< x y) (- y x))
(else (square x)) ))
- true/false or short answer questions about programming concepts
we've covered such as
the distinction between an iteration (or tail recursion) and a
linear recursion that is not an iteration.
the order of growth of the two ways of doing exponentiation, of gcd,
of fast or slow prime?
abstraction barriers
procedures as parameters and as returned values
- Problems about writing procedures in scheme:
(a) writing procedures which are possible directly from memory (i.e.
have been defined in the book or in class, or have been homework.
For example, define
sqrt, factorial, fib, expt, fast-expt, gcd, sum, length, the functions
about the digits of a number. Note it is not expected that you will
rote memorize these, rather that you will remember the specifications
and the methods enough to be able to recreate procedures to compute them.
(b) writing specified procedures which are only similar to ones
we've done. For example, define a procedure to compute the odd part
of a positive integer. Every integer can be written as a power of 2 times
an odd number. This procedure returns the odd number. For example,
(odd-part 5) --> 5, because 5 = (2^0)*5,
(odd-part 20) --> 5, because 20 = (2^2)*5,
(odd-part 48) --> 3, because 48 = (2^4)*3,
saunders@cis.udel.edu