MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / dfs

Method dfs

tasks/332.go:57–65  ·  view source on GitHub ↗
(itinerary *[]string, from string)

Source from the content-addressed store, hash-verified

55}
56
57func (g *Graph) dfs(itinerary *[]string, from string) {
58 q := (*g)[from]
59
60 for len(*q) > 0 {
61 child := q.deque()
62 g.dfs(itinerary, child)
63 }
64 *itinerary = append(*itinerary, from)
65}
66
67func (q *Queue) deque() string {
68 ret := (*q)[0]

Callers 1

findItineraryFunction · 0.80

Calls 1

dequeMethod · 0.80

Tested by

no test coverage detected