Week 7 Objectives


At the end of today's class you should

KNOW:

BE ABLE TO:

Sample Quiz Questions:

  1. A binary tree contains these values:
          root  -->  15
                    /  \
                  23    16
                   \   /  \
                   9  17   63
                     /       \
                    5         12
                     \
                      37                 
    
    List the order in which the nodes would be visited if the tree was traversed using a postorder traversal.

  2. Write a function called Pack that satisfies the following pre- and post-conditions:
    PRE:  char1 and char2 are characters
    POST: the function returns an unsigned short (i.e. 16-bit unsigned integer) with char1 packed into the
          high-order 8 bits and char2 packed into the low-order 8 bits
    
    You should use the shift and OR bit operations to accomplish the packing.

  3. Draw a hash table with open addressing and a size of 9. Use the hash function "key%9". Insert the keys: 5, 29, 20, 0, 27 and 18 into your table (in that order).