Tuesday, 15 January 2013

Prim's Algorithm


By on 03:36

Prim's Algorithm are those algorithm which is also used to find shortest minimum spamming tree(weight of edges are minimal) like Kruskal's Algorithm.But its way of creation is different.This Algorithm is used in c,c++,java,c# etc.

Example:-




Step 1:-Arrange the edges in increasing order of weight.

Step 2:-Choose the nearest neighbour and add.

Step 3:-Repeat step 2 until it has n-1 vertex and non cyclic.

Step 4:-Exit code.

Solution:-


Prims Algorithm(in graph)




If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...