p87 depth first graph traversal