So when you call depth-first search from U, that recursive call, that's gonna make further recursive calls to all of the relevant neighbors including V and U's call is not gonna get popped off the stack until V's does beforehand, that's because of the last in first out nature of a stack or of a recursive algorithm. 