data-structures-and-algorithms
Code challenge 38:
Graph-Depth-First
To Write the following method for the Graph class:
depth first
Arguments: Node (Starting point of search)
Return: A collection of nodes in their pre-order depth-first traversal order
Display the collection
Approach & Efficiency
test result:
Big O
Time <— O(n)
Space <—– O(n)