Homework 4 Information, ECS50 Spring 2007
- Do all problems.
- Written homework due by 4:45 PM on Monday, May 7th
- Programs due by Midnight on Monday, May 7th
Assignment:
(1) Problem 6.1 (b), (c), (e), (f), (f), (g) (not a misprint! :-)
(2) Problem 6.2
(3) Problem 6.3
(4) Problem 6.5
(5) Problem 6.7 using the following calls:
procedure Batman(a:integer_array; b:integer)
function Robin(var c,d: integer; e,f:integer_array; g:integer):integer;
(6) Problem 6.8 using above information
(7) Problem 6.9 using above information
(8) Problem 6.11 (program), with the following modifications:
The focus of this problem is not on the sorting algorithm, but on the
procedure call aspects. So use the simplest sort of all: Find the
minimum and put it at position 1, then find the next minimum and put
at position 2, etc. So the program will be something like:
procedure MIN(var data: int_array, n: start_address, m: last_address)
(finds the minimum of data[n] through data[m] and swaps to
keep the minimum at data[n].
The main program will than be:
LOAD()
call procedure MIN m number of times to sort the array.
PRINT()
(9) Problem 6.12 (program), with the following modifications:
Instead of just printing out the frequency of occurance for each
addressing mode, use the procedure from problem 6.11 to print out a
sorted list of frequencies.
(10) Problem 7.3 (program - start with example 7.13, "tostr.csp" in chap7 dir)
(11) Problem 7.7