Monday, May 25, 2009

Erratum (part 3) for D. S. Malik's "Data Structures Using C++"

On page 738 is an explication of Dijkstra's shortest path algorithm. Everything makes sense to me except step 2:
Set smallestWeight[vertex] = 0
This is because step 1 is:
Initialize array with smallestWeight[u] = weights[vertex, u]
Unless I misread something (or the weight from a node to itself isn't zero), I assume that step 1 subsumes step 2. Or am I missing something?

See also other errata.

No comments: