#### Lab Quiz, Data Structures and Algorithms, Week 5 -- Thurs Oct 23 2001

Name:

1. Write down the values of these powers:
 a.) 12 b.) 22 c.) 52 f.) 102 g.) 10002

2. Write down the values of these powers:
 a.) 13 b.) 23 e.) 53 f.) 103 g.) 10003

3. Write down the values of these exponents:
 a.) 20 b.) 22 d.) 28 e.) 101 f.) 103 g.) 106

4. Write down the values of these logs:
 a.) log21 b.) log24 c.) log2256 e.) log1010 f.) log101000 g.) log101000000

5. Write down the values of these functions of N for the specified values of N:
 a.) 10N2, N = 10 b.) 0.1N3, N = 10 c.) 10N2, N = 100 d.) 0.1N3, N = 100

6. Write down the order (Big-O) of these functions of N:
 a.) 10N2 b.) 0.1N3 c.) Which has the larger order, a. or b. ? d.) Write down a value of N where b. exceeds a.

7. Write down the order (Big-O) of this code fragment:
```
for (i = 0; i < n; i++)

for (j = 0; j < n; j++)

sum = sum + a[i]*b[j]

```

8. On the back of this sheet, sketch the graphs of the two functions N and N2 on the same coordinate axes. Your sketch can be quite crude. Just show the shapes of the graphs, it is not necessary for the graphs to be numerically accurate, or to scale, or for the axes to have coordinates marked.

In a second (crude) drawing, sketch the graphs of the two functions N and log N on the same coordinate axes.