Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I.

Similar presentations


Presentation on theme: "1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I."— Presentation transcript:

1 1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I

2 2 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack:

3 3 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: visit(F) F-E

4 4 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G

5 5 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G dfs(C) C-A C-D

6 6 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G dfs(C) C-A C-D

7 7 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G dfs(C) C-A C-D dfs(D) D-C D-F

8 8 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G dfs(C) C-A C-D dfs(D) D-C D-F

9 9 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G dfs(C) C-A C-D dfs(D) D-C D-F

10 10 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G dfs(C) C-A C-D

11 11 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G

12 12 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G

13 13 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G dfs(G)

14 14 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E dfs(E) E-C E-D E-G

15 15 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack: dfs(F) F-E

16 16 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack:

17 17 Directed Depth First Search F A B C G D E H I dfs(A) A-F A-G Function call stack:

18 18 Directed Depth First Search F A B C G D E H I Nodes reachable from A: A, C, D, E, F, G


Download ppt "1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I."

Similar presentations


Ads by Google