Lab Quiz, Data Structures and Algorithms, Week 4 -- Tues Oct 16 2001

Name:

  1. Write down the values of these powers:
    a.) 12 b.) 22 c.) 32 d.) 42 e.) 52 f.) 102 g.) 1002


  2. Write down the values of these powers:
    a.) 13 b.) 23 c.) 33 d.) 43 e.) 53 f.) 103 g.) 1003


  3. Write down the values of these exponents:
    a.) 21 b.) 22 c.) 23 d.) 24 e.) 101 f.) 102 g.) 103


  4. Write down the values of these logs:
    a.) log22 b.) log24 c.) log28 d.) log216 e.) log1010 f.) log10100 g.) log101000


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


  6. Write down the order (Big-O) of these functions of N:
    a.) 100N2 b.) 0.01N3 c.) Which has the larger order, a. or b. ?


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


  8. Write down the order (Big-O) of this code fragment:
    
    for (i = 0; i < n; i++) 
    
       for (j = i; j < n; j++) 
    
          sum = sum + a[i]*b[j]