edited by
1,581 views
0 votes
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})$
edited by

3 Answers

0 votes
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 votes
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

Related questions

1 votes
1 votes
1 answer
1
go_editor asked Mar 28, 2020
478 views
The following determiniotic finite automata recognizes:Set of all strings containing $’ab’$Set of all strings containing $’aab’$Set of all strings ending in $’a...
0 votes
0 votes
0 answers
2
go_editor asked Mar 28, 2020
709 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 votes
0 votes
0 answers
3
go_editor asked Mar 28, 2020
1,163 views
The maximum number of nodes in a binary tree of depth $10$:$1024$ $2^{10}-1$ $1000$None of the above
1 votes
1 votes
1 answer
4
go_editor asked Mar 28, 2020
1,277 views
The regular expression given below describes:$r=(1+01)$*$(0+\lambda)$Set of all string not containing $’11’$Set of all string not containing $’00’$Set of all stri...