In a binary min-heap the maximum element will always remain in the leaf node
Let us consider that all the elements in the heap is stored in an array of n+1 elements starting from index 1.(We are keeping index 0 free for easier and minimal calculations, it can be done with index 0 also)
For a given node arr[i],
the left child will be – arr[2*i]
the right child will be – arr[2*i + 1]
The leaf nodes cannot have any child, so the value of 2*i will always exceed n, that means any leaf node will come after any non leaf node in the array representation, so we have to traverse the last floor(n/2) + 1 elements to get the maximum element.
Total number of leaves = 511 + 1 = 512
To find the maximum of 512 elements we have to do atleast 511 comparisons.