MakeContributions / DSA

Data Structure and Algorithm (DSA) contributions
MIT License
731 stars 772 forks source link

Bugfix prims java #1305

Open andysama79 opened 10 months ago

andysama79 commented 10 months ago

PR Checklist:

What kind of change does this PR introduce? (check at least one)

Briefly describe the changes in this PR

Implemented the Prim's algorithm for sparse graphs represented as adjacency list in Java.

Other information:

The previous implementation was buggy, I could not reproduce the bug but on closer inspection I found some iterators were not defined. Also, the code was done within a single block making it incomprehensible. The new implementation is more modular in nature.

welcome[bot] commented 10 months ago

Thanks for opening this pull request! Please check out our contributing guidelines.