Let G(V, E) be a directed graph where every edge has weight as either 1, 2 or 5, what is the algorithm used for the shortest path from a given source vertex to a given destination vertex to get the time complexity of O(V+E)?
(a) BFS
(b) DFS
(c) Binary search
(d) Radix sort
I got this question in an interview.
My doubt stems from Different Path in a Graph in section Graphs of Discrete Mathematics