Say u r talking about min heap
$I)$ For initially sorted order number of comparison will be $0$
$II)$ For reverse sorted order
for level $1$ (i.e. at root) number of comparison will be $0$
for level $2$ number of comparison for each element will be $1$
for level $3$ number of comparison for each element will be $2$
for level $4$ number of comparison for each element will be $3$
So, total number of comparison will be $0+1+1+2+2+2+2+3=13$
Now, to sort elements , we need to count first sortest element, 2nd shortest element like below logic
https://gateoverflow.in/269595/madeeasy-subject-test-2019-programming-%26-ds-heap
Which takes $0+1+2+3+2+2+1=11$
So, total comparison will be $11+13=24$
//Similar thing happens for max heap too