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

Factor out the GCF 7x+49
Factor out the GCF 7x+49
2 dice are rolled. What is the probability that the sum of the numbers rolled is a number greater than or eaqual to 5
What is 1/4 of 10 explain
what is the meaning of when the ruler behaves himself correctly, the people will also
How long does a horse take to run a distance of 6 miles at 16 miles/hour
Which of the following organic compounds is the main source of energy for living things?a.carbohydratesc.nucleic acidsb.lipidsd.proteins
Which of the following organic compounds is the main source of energy for living things?a.carbohydratesc.nucleic acidsb.lipidsd.proteins
the sum of 3 consecutive integers is 90. find the largest integer if x is the smallest integer
2 dice are rolled. What is the probability that the sum of the numbers rolled is a number greater than or eaqual to 5