Consider a set whose elements are integers in the range . A popular scheme for representing a set of this type is by means of a boolean array, , where we say that is in if and only if is true. Since each cell of can be represented with a single bit, is sometimes referred to as a bit vector.

  1. Write the pseudocode to insert an element into set , assuming that a bit vector is being used to store the data.
  2. Write the pseudocode to delete an element from set , assuming that a bit vector is being used to store the data.

Suppose I create a perfect skip list with the values 3, 4, 7, 12, 13, 14, 17.

  1. Sketch a diagram of the skip list, showing which nodes are connected at which “levels”.
  2. Sketch the path that would be taken through the skip list if you are searching for the number 12.
  3. Sketch a diagram (or set of diagrams) that show how you would insert the number 15 into the skip list.
  4. Sketch a diagram (or set of diagrams) that show how you would remove the number 7 from the skip list.