QUIZ STL QUESTION 11

Here, if compare function is already given then why is my answer not matching the solution as it just gives the last insted of first in answer.

Hello @rai.tejas1998
ans is 5 15

first thing is this is not sorting
it is a compare function which will be used while building priority queue
it’s logic is reverse of sort function because in sort function we swap a element to put it ahead
but here we swap elements in heapify function
we swap element with it’s parent when we there is misarrangement
so it is just reverse of sort function logic
if you have any further doubt you can ask here;
Happy Learning!!