Winter 2000
CSE 326: Exercise Set 1
due Wednesday, April 5
Recursion and Algorithm Analysis
- 1. Page 38, Ex. 1.5, paper and pencil only. Trace it
for N=7.
- 2. Page 62-3, Ex. 2.7
- a. paper and pencil
- b. requires coding simple loops and runing them (see below)
- c. compares results of a. and b.
- 3. Page 64, Ex. 2.13, paper and pencil only.
- 4. Page 64, Ex. 2.14 paper and pencil. Answer c. in
Big-Oh notation.
How to time a segment of code:
#include <time.h>
void main()
{
clock_t start, end, runTime;
start = clock();
/* Put your code here. */
end = clock();
runTime = end - start;
}