Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add prim algorithm to find mst #710

Merged

Conversation

jafar75
Copy link
Contributor

@jafar75 jafar75 commented Mar 15, 2024

Prim's algorithm is one of the most well known algms for finding minimum spanning tree of a weighted undirected graph, alongside Kruskal's algorithm. I thought it is better to implement it, and repo users can now use both of these algorithms and maybe do any comparison for educational purposes.

to implement the algorithm more efficiently, built-in binary heap in container/heap is used as a priority queue.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.65%. Comparing base (237d88f) to head (230b23e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #710      +/-   ##
==========================================
+ Coverage   86.58%   86.65%   +0.07%     
==========================================
  Files         196      197       +1     
  Lines        6483     6519      +36     
==========================================
+ Hits         5613     5649      +36     
  Misses        730      730              
  Partials      140      140              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raklaptudirm raklaptudirm merged commit 0254892 into TheAlgorithms:master Mar 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants