Homework 5

Due Thursday, October 27
5 points.
  1. (3 points) Give an argument that the two-stack implementation of a queue (see PA4) has an amortized O(1) run time for add() and remove() operations.

  2. (1 point) What conditions does a binary search tree satisfy?

  3. (1 point) Why are rotations used for binary search tree rebalancing operations?