In a max-heap containing n elements, what is the position of the element with the least value?

Possibly in any leaf node
  • n-1
  • n+1
  • n
  • 2*n+1
  • 2*n+2
  • 0
  • The leftmost leaf node
  • The rightmost leaf node

Remember this is a max-heap. So where is the smallest element?

It has to be at the bottom.

But, it could be anywhere at the bottom.