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]); } }
static private PriorityQueue.Element <Vertex> updateKey(PriorityQueue.Element <Vertex> element) { element.Key = element.Data.CumulatedWeight; return(element); }