In a tree, every node has an edge 'pointing' to it, except for one root node.
You're trying to use Prim's Algorithm, not some "prism" algorithm. Read what Prim's Algorithm is, and follow the instructions the algorithm gives you.
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Offline 2,480 posts
since Jun 2005