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

Test Two: If breed a short fur, Ff female with a short fur, Ff male, then I will expect to see (all short fur some short and some long fur: all long fur) offspr
slimpfy 48 show all steps
Can I get step by step help on numbers 52,54,60, and 64 please
Define the following parts of an arch: - impost - keystone - voussoirs
If thee is a decimal located between
Nfbfjfbfjdbdjdbejdbejd
Help please. I need to find the measure of x°.
The __________ Plain stretches across northern India and is home to one-tenth of the world's population.
Italy’s economy has improved in recent years because of _____. A. growth of areas used for farmland S. low unemployment in rural areas D. government support of
anyone excited for april 12 its when the new bts album is released ! IM QUAKING