Prims algorithm graph


plz tell why this code of prim algo is not working …
also provide the code after correcting it…

@S19LPPP0202 there was a simple mistake in line 23 of your code i have corrected it check here https://ide.codingblocks.com/s/236303

if minvertex==-1 means you have to update it
why is this so??

@S19LPPP0202 if you do not update when minvertex==-1 means your minvertex will never get updated and will remain -1.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.