Hi everyone,
I was solving this question from the recent contest Biteration 3 . CodeChef: Practical coding for everyone
In djisktra algo , we always chose the minimum dis unvisited node in every iteration , so i had declared a done[] array to keep track of unvisited nodes and put the nodes in a priority queue . But using this approach gives WA.
https://www.codechef.com/viewsolution/34835048
Now , if I dont keep track of the unvisited nodes , then it somehow gives correct answer CodeChef: Practical coding for everyone
I am curious to know what is the reason for this behavior . Maybe if someone can point a testcase for difference.
Thanks
PS : In both the above submission please look at the section labelled as “See this section”