You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For our verification of correctness and running time of heapsort we use a sub program heapify_btu.
We prove that it runs in O(n log n) because this suffices to prove heapsort in O(n log n), but it actually is O(n)
At the moment the cost of each sift_down operation is linear in the length of the slice h-l, but actually, that needs to be refined to be dependent on the position l' for which siftdown is called.
For our verification of correctness and running time of
heapsort
we use a sub programheapify_btu
.We prove that it runs in O(n log n) because this suffices to prove
heapsort
in O(n log n), but it actually is O(n)isabelle_llvm_time/thys/examples/sorting/Sorting_Heapsort.thy
Lines 1741 to 1746 in 7176c81
Prove that
heapify_btu
is a linear time algorithm.A proof sketch can be found here: https://en.wikipedia.org/wiki/Binary_heap#Building_a_heap
An Intuitive explanation can be found following the Pseudocode in https://en.wikipedia.org/wiki/Heapsort#Pseudocode .
At the moment the cost of each sift_down operation is linear in the length of the slice
h-l
, but actually, that needs to be refined to be dependent on the positionl'
for which siftdown is called.One would need to relax:
isabelle_llvm_time/thys/examples/sorting/Sorting_Heapsort.thy
Lines 1618 to 1621 in 7176c81
The text was updated successfully, but these errors were encountered: