i am using prim’s to find the solution i am adding the cost of those edges which we exclude from the solution of mst
please help me with my code
Please help me with the code of this problem
@be10046.19
u have been given a threshold cost i.e ur sum total cannot exceed that cost which u r not considering it in ur code.
the idea is For the graph to remain connected, leave the edges of the MST. Now sort the remaining edges in the increasing order of their cost, remove the edges until the sum of costs of removed edges doesn’t exceed the allowed total cost, s .
will this code work it has some errors also please see
@be10046.19
no ,
how u will know about edges that are not part of mst.
even here->
u are adding same element again n again
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.