Added Dijkstra O(mlogn) alg from part-1, optimizing 4 compatibility with B-F alg