Dijkstra runs in O(E log V) time. //Time complexity is different when Data Structures used are different)
BFS runs in O(E + V) time. //adjacency list.
A BFS can be seen as a lightweight version of Dijkstra's algorithm, that can handle only unweighted graphs (or the graphs in which each edge weighs equally; same thing)
Option D
Other uses of BFS/DFS:-
- Checking if the graph is connected. And, finding connected components — also can find the number of nodes in a connected component. It can also check if a graph is cyclic or acyclic. Also, for topological sorting. (DFS can do all this, too)
- DFS can be used to find cut edges and vertices.
- BFS can be used as a lightweight version of Dijkstra. It can also check if a graph is bipartite.