in Algorithms edited by
1,162 views
0 votes
0 votes

What will be the running-time of Dijkstra's single source shortest path algorithm, if the graph $G(V,E)$ is stored in the form of an adjacency list and binary heap is used?

  1. $O (\mid V \mid 2)$
  2. $O (\mid V \mid \log \mid V \mid)$
  3. $O ( ( \mid E \mid+\mid V \mid ) \log \mid V \mid )$
  4. $O( \log \mid V \mid )$
in Algorithms edited by
by
1.2k views

2 Answers

0 votes
0 votes
Best answer
The running time will be O ( ( |E|+|V| ) log |V|) when we use adjacency list and binary heap.
selected by

3 Comments

Sir,

I think the running time is O( ( |E| +|V| ) log|V| )
1
1
@Bikram sir  .. should not it be   O( ( |E| +|V| ) log|V| )    ?
0
0
yes, it should be, corrected it , thanks.
0
0
0 votes
0 votes

@Bikram sir, please help as we know Dijkstra's take O(ElogV) and as it is linklist  implentation it will be sparks graph  E is O(V) so answer should be O(Vlog V)

1 comment

O ( ( |E|+|V| ) log |V|)... we use adjacency list and binary heap.
0
0
Answer:

Related questions