Depth First Search implementation in JavaScript
This is part of a series of exercises to help me improve my understanding of programming languages and styles.
Implementation as described by Prof. Erik Demaine in a recorded lecture at MIT.
The graph constructed in the test is represented in the diagram shown on the right.
$ node dfs_test.js
# => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
JavaScript | Python | |
---|---|---|
Breadth First | bfs-js | bfs-python |
Depth First | dfs-js | dfs-python |