Heapsort O(n lg n) worst case Another design paradigm –Use of a data structure (heap) to manage...
31
Heapsort • O(n lg n) worst case • Another design paradigm – Use of a data structure (heap) to manage information during execution of algorithm • Comparision-based Sorting Algorithm Analysis of Algorithms 1
-
Upload
mariela-thor -
Category
Documents
-
view
223 -
download
0
Transcript of Heapsort O(n lg n) worst case Another design paradigm –Use of a data structure (heap) to manage...
Heapsort
• O(n lg n) worst case• Another design paradigm
– Use of a data structure (heap) to manage information during execution of algorithm
• Comparision-based Sorting Algorithm
Analysis of Algorithms 1
How fast can we sort?
• The comparison sorting algorithms such as insertion sort, mergesort, quicksort and heapsort only use comparisons to determine the relative order of elements.
• The best worst-case running time that we’ve seen for comparison sorting is O(n lg n) .
Is O(n lg n) the best we can do?
• Decision trees can help us answer this question.
Analysis of Algorithms 27