Elements in priority queue i.e. HEAP at backend are sorted
- whenever pq.top() occurs in code OR
- they are sorted during insertion time only i.e. pq.push§?
At backend elements are not in the sorted form ?
Because in the output (9:22 time) it can be seen for every pq.top(), PersonCompare() was called which was checking for priority.