For anyone who struggled like me at 5:27 if(minValue > dist[nodeId]) continue; And then at 6:26 double newDist = dist[nodeId] +edge.cost thinking that since we are checking for minValue to be less than dist of node then hiw come we take the value in dist array without updating is: The line if(minValue > dist[nodeId]) continue; is redundant because every time we poll a value from the queue the value in dist array and minvalue are both same as while inserting to queue we also update dist with same value.. so thats why these both can be used interchangeably.
I like the way you explain things with animation! Thank you for your videos! But when it comes to the code, everything is so bloated, poorly named, I just cant :(
Thanks for the feedback Aureliano, I think the long variable names have stumped others in the past too. I've made note of this and will try to be less wordy