I’m an working on a question where I have 10 keys and I have to make a bottom up construction. According to my book, I’m supposed to construct (n+1)/2 heaps which is 11/2=5.5 heaps for the bottom. Then 11/4 for the 2nd level, 11/8 for 3rd and so on.
The problem is I get this as result:
(Using ‘a’ for example)

Since 11/2=5.5, so I round to 6, 11/4=2.75 so 3, 11/8=1.375 so 2, and 11/16=0.6875 so 1.
Even if I don’t round up, I still have a weird heaps. Can anyone explain where I messed up?
You messed up because only the last layer in a binary heap is allowed to not be full. A heap with 10 elements should look like this:
As for the bottom up construction you don’t need to think too much about the amount of heaps. The basic idea is that
So at the start we know that the nodes in the 4th layer (8, 9 and 10) are already heaps. We can then use this to bubble the nodes in the third layer to turn them into heaps as well and so on.