I need to prove that for binary heaps, BuildHeap does at most 2N-2
comparisons between elements.
I tried many approaches but i'm stuck.
I know that Build-Heap calls Heapify N/2 times.
each Heapify call you get 2 comparisons. the element with it's two sons.
then you have a recursive call to haepify.
can anyone help me with that?