예제 #1
0
 static private void sortHeap(ref PriorityQueue.Heap <Vertex> heap)
 {
     PriorityQueue.Element <Vertex>[] updatedKeys = new PriorityQueue.Element <Vertex> [heap.NumberOfElements];
     for (int i = 0; i < updatedKeys.Length; i++)
     {
         updatedKeys[i] = updateKey(heap.deleteMax());
     }
     for (int i = 0; i < updatedKeys.Length; i++)
     {
         heap.insertElement(updatedKeys[i]);
     }
 }
예제 #2
0
 static private PriorityQueue.Element <Vertex> updateKey(PriorityQueue.Element <Vertex> element)
 {
     element.Key = element.Data.CumulatedWeight;
     return(element);
 }