Tree balancing
==============

Using the approach from DJW, balance the binary search tree consisting
of the values:

> 1, 1, 1, 4, 5, 6, 7

What is its height?

a.  2
b.  *3* (because DJW's `add` always adds equal values to the left subtree)
c.  4
d.  5

DFS optimality
==============

In general, is depth-first search guaranteed to find the optimal
(shortest) path between two vertices in a graph of finite size?

a.  yes, but only if one exists
b.  yes, but only if $|E| < |V|^2$
c.  yes, but only in a graph with one connected component
d.  *no* (it depends upon the order of neighbor enumeration)

DFS space
=========

Suppose that each vertex on a graph has $b$ neighbors, and that a DFS
has progressed to a depth of $d$ from the starting node. About how many
vertices are on the stack?

a.  $b$
b.  $d$
c.  *$bd$*
d.  $b^d$
e.  $d^b$

BFS optimality
==============

In general, is breadth-first search guaranteed to find the optimal
(shortest) path between two vertices in a graph of finite size?

a.  *yes, but only if one exists*
b.  yes, but only if $|E| < 2|V|$
c.  yes, but only when the graph is undirected
d.  no

BFS space
=========

Suppose that each vertex on a graph has $b$ neighbors, and that a BFS
has progressed to a depth of $d$ from the starting node. About how many
vertices are on the queue?

a.  $b$
b.  $d$
c.  $bd$
d.  *$b^d$*
e.  $d^b$

