I am busy preparing for exams, just doing some old exam papers. The question below is the only one I can’t seem to do (I don’t really know where to start). Any help would be appreciated greatly.
Use the Ω(nlogn) comparison sort bound, the theta(n) bound for bottom-up heap construction, and the order complexity of insertion sort to show that the worst-case number of inversions in a heap is Ω(nlogn).
The complexity of insertion sort is O(n+d) where d is the number of inversion pairs.
Now say you had a set of numbers, which you heapify (Theta(n)) and then perform insertion sort on them. What does it say about the worst case number of inversion pairs in the heap array?