Dijektras algorithm

what is the best time complexity to impliment dijektras??

  • With Adjacency List and Priority queue: O((v+e) log v) -> in worst case : e>>v so O( e log v)
  • With matrix and Priority queue: O(v^2 + e log v) -> in Worst case e ~ v^2. So O(v^2 + e log v) ~ O(e + e log v) ~ O(e log v).

SO best case O(Elog V)
where E is the number of edges and V is the number of vertices

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.