B/DFS pseudocode