• recategorized by
2,463 views
0 0 votes

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

  1. $O(e)$
  2. $O(n)$
  3. $O(e^{2})$
  4. $O(n^{2})$

3 Answers

0 0 votes
Dijktra's algorithm's time complexity is     V.log(V) + E  (using fibonacci heaps). They have given #edges as 'e'. Now, 'e' can be equal to V*V. Also, the notation being used is big-O. So, answer is (D).
0 0 votes
Undirected graph

BFS=O(V+E)=O(n+e)

Directed graph

dijkstra algorithm with list = O($V^{2}$)=O($n^{2}$)

dijkstra algorithm with binary heap=O((E+V)LOGV)=O((e+n)log(n))

dijkstra algorithm with fibbonacci heap=O((E+VLOGV)=O((e+nlog(n))

Bellman ford algorithm=O(VE)=(ne)

ANSWER SHOULD BE OPTION D
Answer:
Position:
Show:

Related questions

0 0 votes
1 1 answer
648
648 views
go_editor asked Mar 28, 2020
648 views
Which algorithm has some average, worst case and best case time:Binary searchMaximum of $n$ numbersQuick sortFibonacci search
1 1 vote
0 0 answers
1.1k
1.1k views
go_editor asked Mar 28, 2020
1,139 views
Depth ion travels of the following directed graph is: $\text{A B C D E F}$$\text{A B D E F C}$$\text{A C E B D F}$None of the above
0 0 votes
1 1 answer
141
141 views
Shubham Sharma 2 asked Apr 19
141 views
Match the LIST-I with LIST-IILIST-ILIST-IIA.Dynamic programmingI.Floyd Warshall Shortest pathB.GreedyII.Huffman codingC.Back trackingIII.Hamiltonian cycle problemD.Branch...
0 0 votes
1 1 answer
622
622 views
Shubham Sharma 2 asked Sep 9, 2025
622 views
Match List - I with List - II.$\begin{array}{|ll|ll|} \hline & \textbf{List - I} & & \textbf{List - II} \\ \hline (A) & \text{Dijkstra's Algorithms} & (I) & \text{Find th...