code/spannbaeumePrim.code
author lindenmannm
Tue, 22 Feb 2011 19:02:39 +0100
changeset 3 0d0e9abd157b
permissions -rw-r--r--
hh
     1 forall(v:V)
     2     Insert(Q, infty, v);
     3 Wähle einen Knoten w:V als Wurzel;
     4 DecreaseKey(Q, 0, w);
     5 p[w]=nil;
     6 while(!Empty(Q)) {
     7     (d,u)=DeleteMin(Q);
     8     forall((u,v):E)
     9         if(v:Q && c(u,v)<v.Key) {
    10             DecreaseKey(Q, c(u,v), v);
    11             p[v]=u;
    12         }