Add depth-first function and an alternative to breadth-first.