Directed Depth First Search A Adjacency Lists B H C I D F E G A: B: C: D: E: F: G: H: I: F G A H A D C F C D G E: : B: H: 1 Directed Depth First Search A B H C G I D F E dfs(A) A-F A-G Function call stack: 2 Directed Depth First Search A B H C G I D F E visit(F) F-E dfs(A) A-F A-G Function call stack: 3 Directed Depth First Search A B H C G I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 4 Directed Depth First Search A B H C G dfs(C) C-A C-D I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 5 Directed Depth First Search A B H C G dfs(C) C-A C-D I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 6 Directed Depth First Search A dfs(D) B H C G D-C D-F dfs(C) C-A C-D I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 7 Directed Depth First Search A dfs(D) B H C G D-C D-F dfs(C) C-A C-D I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 8 Directed Depth First Search A dfs(D) B H C G D-C D-F dfs(C) C-A C-D I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 9 Directed Depth First Search A B H C G dfs(C) C-A C-D I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 10 Directed Depth First Search A B H C G I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 11 Directed Depth First Search A B H C G I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 12 Directed Depth First Search A B H C G dfs(G) I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 13 Directed Depth First Search A B H C G I D dfs(E) E-C E-D E-G F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 14 Directed Depth First Search A B H C G I D F E dfs(F) F-E dfs(A) A-F A-G Function call stack: 15 Directed Depth First Search A B H C G I D F E dfs(A) A-F A-G Function call stack: 16 Directed Depth First Search A B H C G I D F E dfs(A) A-F A-G Function call stack: 17 Directed Depth First Search A B H C G I D F E Nodes reachable from A: A, C, D, E, F, G 18
© Copyright 2026 Paperzz