
20 Mar
2009
20 Mar
'09
9:33 p.m.
AMDG dwaem wrote:
int weight[] = {1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7};
<snip>
it shows distances and parents: distance(A) = 0, parent(A) = C distance(B) = 0, parent(B) = A distance(C) = 0, parent(C) = C distance(D) = 0, parent(D) = C distance(E) = 0, parent(E) = C
which makes no sense.
You're not using the weight array anywhere, so you get the default weight of 0 for every edge. In Christ, Steven Watanabe