A small question but I can’t find a good explanation on how to achieve what I am trying. I am trying to implement a Dijkstra’s algorithm. And I need to use a PriorityQueue.
I want to compare the different vertices of a graph depending on their distance.
But I don’t really know how to write such a compare method because I have never used a PriorityQueue.
as for CompareTo function: