DSC 40B Practice Problems

Problems tagged with "trees"

Problem #156

Tags: depth first search, trees

What is the time complexity of depth first search (DFS) when run on a tree with \(n\) nodes?

Solution

\(\Theta(n)\)