CSE 101 Final Cheat Sheet
CSE 101 Final Cheat Sheet
and
·
huput graph starting Vertex
·
Runtime OCIUIHED
·
output Dfs forest (forest structure given by prev
array
·
Rentine OCIUIHEl)
Input graph
·
output sec
·
Runtime OCIVI + IE)
·
Runtime OCIUI + IE1)
Peter
Dijkstral finds shortest path
verter
:
Impact and
starting
graph
·
Algo :
pick smallest edge that keeps corrected
~
Runtime =
Dijkstra
· OCVR +
/EllogIvi) leader method
Edge type : Tree edge : solid edge in DAS
Back edge : leads to crestor
Cross : neither
met .
Let of be a valid solution that doesn't include g Then
.
,
there exists a os
solution
by adding g
to os
,
show Os'LOS.
Good dAnd
=>
Hamiltonian = ND
TSP in NP