###### Greedy-approach

October 26, 2023###### Operating-Systems

October 26, 2023# Greedy-approach

Question 22 |

The time required to find shortest path in a graph with n vertices and e edges is :

O(e) | |

O(n) | |

O(e ^{2}) | |

O(n ^{2}) |

Question 22 Explanation:

→ We can use dijkstra’s algorithm to find shortest path in a graph with n vertices and e edges is O(ElogV).

→ We know that E ≤ V

→ We know that E ≤ V

^{2}if graph is complete and time complexity is O(n^{2})Correct Answer: D

Question 22 Explanation:

→ We can use dijkstra’s algorithm to find shortest path in a graph with n vertices and e edges is O(ElogV).

→ We know that E ≤ V

→ We know that E ≤ V

^{2}if graph is complete and time complexity is O(n^{2}) Subscribe

Login

0 Comments