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

List 5 words that describe you.
What is the unit rate for 25 rulers in 5 groups
The Constitution grants the federal government several financial, which include the_____, ____, and___. Even though federal government is given certain powers,
Which triangle is a translation of the gray triangle? O ΔDEF Ο ΔABC O Neither
Find the volume of a cone with a radius of 10 inches and a height of 13 inches.​
Which ratio is bigger? 6:10 or 8:15
summary of federal farmer letter 14
why did democracies finally agree to protect poland
plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz helppppppppppppppppp me i do anyhting just help[ show your work A small pool is leaking water from a hole. After 2 ½ min
Write a journal entry about mummification. Must be at least 250 words. Must be about a verifiable historical event, person, phenomenon, or trend. Must cite sour