DSC 40B – Theoretical Foundations of Data Science II


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)\)