Glossary: Data Structures and Algorithms in JavaScript
Depth-first search (DFS)
Also written: DFS, depth-first search
A graph search that goes as far as it can down one road before backing up to try the next. It finds everything reachable and can be written with recursion or a stack.