In case of Dijkstra's algorithm (one of the implementations of the link-state…

In case of Dijkstra's algorithm (one of the implementations of the link-state algorithm), if n is the number of nodes (excluding the source), how many number of nodes does one need to search in the worst case through all the iterations?

  1. A.

    n²

  2. B.

    n(n+1)/2

  3. C.

    n³

  4. D.

    n²logn

Attempted by 298 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…