Comparing the values at the top . If the value of heap A [ ] is greater , then counter is incremented
if ( pq1 . peek ( ) . compareTo ( pq2 . peek ( ) ) == 1 ) { c ++ ; pq1 . poll ( ) ; pq2 . poll ( ) ; } else { if ( pq2 . size ( ) == 0 ) { break ; } pq2 . poll ( ) ; } } return ( c ) ; }