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

The sun reaches its highest point in the Northern sky (North of the equator) on the: A. Summer solstice B. Winter solstice C. Vernal Equinox D. Autumnal Equinox
FREEEEEEEEEEE POINTSSSSSSSSSSSSs
na jca.kyerɛw Krataa KemaKyerekpereny,Siantsina anta asosdzenwayss no nkyaYEal​
how many neutrons does this atom of argon have?
A man travels 2 miles, turn left and travels 3 miles, turn left again and travel 6 miles. How far is he from the starting point?​
circle are polygons true or false​
The measures of two angles of a triangle are 103° and 38°. Find the measure of the third angle in degrees.
a sample of gas has a volume of 100.0L at 135C assuming the pressure remains constant
Please help I’ll mark Brainlyist <3 A major result of the Civil Was was? A ) The south became a leading manufacturing center. B ) Slavery came to an end.
Please solve the exponential equation:2^2x -6(2^x)+8=0​