Skip to content

Conversation

@jyothsnasharma7
Copy link

This PR adds an implementation of Prim’s Algorithm in Java under the ⁠ graphs ⁠ package.
The algorithm finds a Minimum Spanning Tree (MST) of a connected, undirected, weighted graph by repeatedly selecting the minimum-weight edge that connects a vertex in the MST to a vertex outside it.
Reference: [Prim’s Algorithm - Wikipedia ] (https://en.wikipedia.org/wiki/Prim%27s_algorithm)

•⁠ ⁠[x] I have read CONTRIBUTING.md.
•⁠ ⁠[x] This pull request is all my own work -- I have not plagiarised it.
•⁠ ⁠[x] All filenames are in PascalCase.
•⁠ ⁠[x] All functions and variable names follow Java naming conventions.
•⁠ ⁠[x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
•⁠ ⁠[x] All new code is formatted with ⁠ clang-format -i --style=file path/to/your/file.java ⁠.

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2025

Codecov Report

❌ Patch coverage is 0% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.84%. Comparing base (d5289b9) to head (c881f64).

Files with missing lines Patch % Lines
src/main/java/com/thealgorithms/graph/Prims.java 0.00% 34 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6839      +/-   ##
============================================
- Coverage     77.95%   77.84%   -0.12%     
- Complexity     6429     6431       +2     
============================================
  Files           736      737       +1     
  Lines         21476    21510      +34     
  Branches       4204     4208       +4     
============================================
+ Hits          16742    16744       +2     
- Misses         4060     4094      +34     
+ Partials        674      672       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jyothsnasharma7 jyothsnasharma7 closed this by deleting the head repository Oct 29, 2025
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.

2 participants