{"id":1333,"date":"2015-06-08T06:26:11","date_gmt":"2015-06-08T06:26:11","guid":{"rendered":"https:\/\/theoryofprogramming.wordpress.com\/?page_id=1333"},"modified":"2023-12-12T15:16:08","modified_gmt":"2023-12-12T15:16:08","slug":"prims-algorithm-using-cpp-stl","status":"publish","type":"page","link":"https:\/\/theoryofcoding.com\/index.php\/prims-algorithm-using-cpp-stl\/","title":{"rendered":"Prim&#8217;s Algorithm using C++ STL"},"content":{"rendered":"\n<p>Hello people..! This is a special extension to my post on <strong><a href=\"https:\/\/theoryofcoding.com\/index.php\/2015\/03\/27\/prims-algorithm\/\" target=\"_blank\" rel=\"noreferrer noopener\">Prim&#8217;s Algorithm<\/a><\/strong>. Here, I give you a different implementation of Prim&#8217;s Algorithm which uses C++ STL. So, those who are uncomfortable with using pointers should feel just at home with this&#8230;! Provided you know C++ STL..! \ud83d\ude09 &#8230; Some of the features of this code are &#8211;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Adjacency List used is exactly as in <strong><a href=\"https:\/\/theoryofcoding.com\/index.php\/adjacency-list-using-cpp-stl\/\" target=\"_blank\" rel=\"noreferrer noopener\">Adjacency List using C++ STL<\/a><\/strong><\/li>\n\n\n\n<li>The Min Heap is unchanged from the former post on Prim&#8217;s Algorithm. We stick to the array of structs.<\/li>\n\n\n\n<li>The Prim&#8217;s algorithm function uses <a href=\"http:\/\/www.fredosaurus.com\/notes-cpp\/functions\/refparams.html\">C++ reference parameters<\/a> to yield the necessary results.<\/li>\n<\/ul>\n\n\n\n<script src=\"https:\/\/gist.github.com\/VamsiSangam\/69c1141ea381cc10d672444cdd9a4e19.js\"><\/script>\n\n\n\n<p>Keep comparing every strange line with the simple C code&#8230; I&#8217;m sure you&#8217;ll get it..! \ud83d\ude42 &#8230; Feel free to comment if you have any doubts..! Keep practicing..! Happy Coding..! \ud83d\ude00<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello people..! This is a special extension to my post on Prim&#8217;s Algorithm. Here, I give you a different implementation of Prim&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-1333","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/pages\/1333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/comments?post=1333"}],"version-history":[{"count":1,"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/pages\/1333\/revisions"}],"predecessor-version":[{"id":3970,"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/pages\/1333\/revisions\/3970"}],"wp:attachment":[{"href":"https:\/\/theoryofcoding.com\/index.php\/wp-json\/wp\/v2\/media?parent=1333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}