Dijkstra algorithm

IN THIS QUESTION WE HAVE TO IMPLEMENT HEAP ALSO.
IS THERE IS ANY OTHER WAY TO DO THIS?

if you dont want to construct heap from scratch you can use inbuilt priority queue

i have used priority queue but it is giving right answer on sample input

but giving wrong answer

share the link of your code here


my code link

dont use tree map in code…use hashmap and write an updatePriority function

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.