pull/2/head
Oliver Kennedy 2022-10-07 15:40:09 -04:00
parent ecfe40f4c0
commit ae2d0d25e8
Signed by: okennedy
GPG Key ID: 3E5F9B3ABD3FDB60
1 changed files with 7 additions and 1 deletions

View File

@ -459,6 +459,12 @@ def DFSOne(graph: Graph[…], v: Graph[…]#Vertex)
} </code></pre>
</section>
<section>
<p>What's the runtime of <tt>DFSOne</tt> <b>excluding recursive calls</b>?</p>
$$O(deg(v))$$
</section>
<section>
<h4 class="slide_title">Depth-First Search</h4>
@ -474,7 +480,7 @@ def DFSOne(graph: Graph[…], v: Graph[…]#Vertex)
$ = O(\sum_{v \in V} deg(v))$
</p>
<p class="fragment">
$ = O(2 |E|)$ (by rule)
$ = O(\frac{1}{2} |E|)$ (by rule)
</p>
<p class="fragment">
$ = O(|E|)$