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]);
     }
 }