Homework 4 Information, ECS50 Spring 2000
- Do all problems.
- Homework due by Midnight on Friday, May 5
Assignment:
(1) Problem 6.2
(1) Problem 6.3
(2) Problem 6.6
(3) Problem 6.7 using the following calls:
procedure cowa(z:integer_array; y:integer)
function bunga(x,w:integer; var v,u:integer_array; t:integer):integer;
(4) Problem 6.8 using above information
(5) Problem 6.9 using above information
(6) Problem 6.10
(7) 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()
(8) 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.