Vector-based depth first traversal

Apparently my logical reasoning is better than my memory...