[x] My submission is formatted according to the guidelines in the contributing guide
[x] My addition is on refer on the language README.md file
[x] My addition does not have a spelling problem
[x] My submission has a proper and user-friendly description of the algorithm
[x] My submission has the time complexity of the algorithm
[x] My submission has sample input-output of the program (NOT FOR PYTHON)
What kind of change does this PR introduce? (check at least one)
[x] Bugfix
[ ] New algorithm
[x] Optimization in previous algorithms
[x] Code style update
[ ] Refactor
[ ] Documentation
[ ] Other, please describe:
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.
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.