0

T=Φ
while((T contains less than n - 1 edges) && (E not empty))
{
choose an edge (v,w) from E of lowest cost;
delete (v,w) from E;
if ((v,w) does not create a cycle in T) add (v,w) to T;
else discard (v,w);
}
if (T contains fewer than n-1 edges) cout << "no spanning tree"<<endl;


the above-mentioned is the algorithm. And the MIPS how to write?Thanks a lot.

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by Metsfan147
0

ooh that's Kruskal's algorithm. That is going to be a beast in assembly. I have some java code for it, but I don't think it would be much help. Good luck to you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.