C++ Dijkstra’s algorithm with comments
Dijkstra\'s algorithm finds the shortest path between two given nodes. This question presents a simple graph where each node only has 2 connecting nodes, where 
Dijkstra\'s algorithm finds the shortest path between two given nodes. This question presents a simple graph where each node only has 2 connecting nodes, where the path of traversal between two nodes can either be clockwise or counter-clockwise.\n\n```\n    int distanceBetweenBusStops(vector<int>& distance, int start, int destination) {\n        if(start == destination) return 0;              /* shortest distance between the same node is 0. Can save runtime */\n        int path1 = 0, path2 = 0, n = distance.size();  /* initialize the distance for both paths to 0 */\n        for(int i = start; i != destination; i = (i+1)%n) /* use i = (i+1)%n to iterate and travel back to the start of the vector safely */\n            path1 += distance[i];                         /* add the sub-distances between adjacent nodes */\n        for(int i = destination; i != start; i = (i+1)%n)\n            path2 += distance[i];\n        return min(path1, path2); /* return the shortest pathway distance between the nodes */\n    }\n```
[]