dfs: Depth-first search

Description Usage Arguments See Also

Description

One starts at the root and explores as far as possible along each branch before backtracking.

Usage

1
dfs(s,visited,adj)

Arguments

s

The root node.

visited

N by 1 vector, where N is the number of nodes. This vector records whether nodes have been visited or not with 1 if visited and 0 otherwise.

adj

N by N adjacent matrix.

See Also

getGraph


gTests documentation built on May 2, 2019, 9:15 a.m.