Depth First Search
Note that if a graph is acyclic, we don't need to keep a set of visited nodes to prevent going into a loop.
Example: 797. All Paths From Source to Target (Medium)
Problems
Last updated
Note that if a graph is acyclic, we don't need to keep a set of visited nodes to prevent going into a loop.
Example: 797. All Paths From Source to Target (Medium)
Last updated