The complexity of Depth First Search

1.2k Views Asked by At

Can anyone tell me what's the complexity of Depth First Search? I have no idea about what does mean by the complexity.

1

There are 1 best solutions below

0
On

The time complexity of an algorithm is an estimate, how fast it works depending on the size of input data. This page talks about the time complexity (there is space complexity too - please look yourself).

As for graphs - their size is usually described by two numbers - number of vertices $|V|$ and number of edges $|E|$. So, you need to think about how much total work the DFS algorithm does in terms of these two numbers.