|
|
вернуться в форумWhat is my code doing? Послано Nithin 16 май 2017 22:38 I have implemented a greedy algorithm to solve this problem and it got accepted and after reading the discussion I have noticed that many people used Prims algorithm to solve. I have no idea of what Prims algorithm is. Could anyone please tell me what exactly is my code doing and how is it different from Prims algorithm? [code deleted] Edited by moderator 21.01.2020 16:06 Re: What is my code doing? There are only three algorithms for finding minimal spanning. Their complexities are different, but idea is the same. So, we can say that they all are actually the same algorithm. Your code is most similar to Kruskal's algo. You arr finding the smallest edge and adding it to MST. |
|
|