09.07.2015 Views

slides - Computer Science - University of San Francisco

slides - Computer Science - University of San Francisco

slides - Computer Science - University of San Francisco

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

17-46: Dijkstra Running TimeTotal # <strong>of</strong> times the if statement will be executed:for (i=0; i < G.length; i++) {v = minUnknownVertex(T);T[v].known = true;for (e = G[v]; e != null; e = e.next) {|> if (T[e.neighbor].distance >|> T[v].distance + e.cost) {|> T[e.neighbor].distance = T[v].distance + e.cost;|> T[e.neighbor].path = v;}}}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!