Merge K sorted Arrays on what parameter is pq formed

when we push a pair in a priority queue how does it form thw max or min heap?? based on key value ?? or somehting else

@khushipriya681
When we push a pair into a priority_queue , the comparison is done on the basis of the first value of the pair. If you want the comparison to be done in any other fashion , you need to a functor ( in case of STL classes like priority_queue or set) or a comparator( in case of sort( ) ).