Dijkstra's Algorithm - Graph problem

It is giving wrong answer… Please suggest the correction.
Is there a method without using minheap?

@ajain4871
Yes,there is a method without using heap.You have overkilled your code with a lot of extra code,please add comments so that it would be easy to debug,or prefer the method without heap.
If you want any help in without heap approach(preferably easy one) revert back here,else if you want to stick to your approach,then please add comments for ease.


This is using matrix to store the values.
It is also giving wrong answer.

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.