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

solve 2x + 6 = x - 4
!!!!!URGENT!!!!!!!! From cells to major organ systems, the architecture of the body and the functions the body can perform are very closely related. Can you ide
How did queen Hatshepsut’s Policies affect the kingdom of Egypt?
_________ alcohol can produce feelings of well-being, seduction, intoxication, or unconsciousness, depending on the amount consumed.​
How can assumptions limit your perception of the world in a detrimental way
CAN SOMEONE PLEASE HELP WITH THIS ITS USING THE DISTRIBUTIVE PROPERTY PLEASE HELP
According to Karen Horney, what causes us to develop a neurotic personality
Please help thanks!!!
One hundred people attended Nick’s game. 61 were adults and 39 were kids. There were 41 males and 59 females. Find the ratio of kids/total attendance
based on average shoe size of 13yr old males. Whats my shoe size A) 12 B) 7 C) 9.5 D) 12.5