barnabas5009 barnabas5009
  • 25-07-2019
  • Computers and Technology
contestada

"What is the running time of HEAPSORT on an array A of length n thatis already sorted in increasing order?

Respuesta :

ExieFansler ExieFansler
  • 31-07-2019

Answer:

The answer to this question is O(NlogN).

Explanation:

The time complexity of Heap Sort on an array A is O(NLogN) even if the array  is already sorted in increasing order.Since the Heap Sort is implemented by creating the heap from the array and then heapifying and then repeatedly swapping first and last element and deleting the last element.The process will be done for the whole array.So the running time complexity is O(NLogN).

Answer Link

Otras preguntas

Comptez Follow the pattern to provide the missing numbers in French. Modèle: 2, 4, 6,huit, dix, douze, quatorze, 16, 18. 60, 62, 64, _ _ _, 80 76, 80, 84, _, _,
I WILL MARK BRAINLIEST
Please! I need it super urgently in like 1/2 hour....I will be super glad
write an essay on a topic that why I must be made the school timekeeper​
CAN ANYONE PLS HELP ME WITH ALL OF THISSS ITS due today and l really don’t get it
1. What major landforms or waterways will be crossed when taking a flight from South Africa to Kuwait? The landforms and waterways should be right under the lin
Explore the realities and impact of colonization efforts in Jamestown, Virginia and Charleston, South Carolina.
Find area and circumference SHOW ALL WORK helppp me
1. Which of the following is unique to eukaryotic cells? ribosomes cytoplasm nucleus cell (plasma) membrane 2. Eukaryotic cells exist in two categories: plant a
Geometry Show work and number