kelvins / algorithms-and-data-structures

:abacus: Algorithms and Data Structures in several Programming Languages
MIT License
1.04k stars 256 forks source link

Adding Dijkstra's algorithm implementation in C++, using min-heap #344

Closed OzPol closed 2 months ago

OzPol commented 3 months ago

Add Dijkstra's algorithm implementation in C++, using a min-heap.

Description

This pull request adds an implementation of Dijkstra's algorithm using a min-heap (priority queue). The algorithm finds the shortest paths from the source vertex to all other vertices in a weighted graph. The implementation includes a sample test case which can be uncommented in the main function for demonstration purposes.

OzPol commented 2 months ago

@kelvins I have uncommented the main function and added the link to the README file as requested. Can you please review the updated changes. Thank you!