call dfs over all neighbors except parent
for i in range ( len ( g [ u ] ) ) : NEW_LINE INDENT v = g [ u ] [ i ] NEW_LINE if v != parent : NEW_LINE INDENT dfs ( g , v , u , timeIn , timeOut ) NEW_LINE DEDENT DEDENT