Modify Upheapify

Could you tell me an alternative method to perform modified upheapify when we use the Collection Framework’s inbuilt PriorityQueue?

Instead of the method discussed in the video, where the change is done on the self-implemented heap data structure.

Thank you.

Yes ofcourse. It is entirely possible to solve this problem using PriorityQueue. However it would be a PriorityQueue of a pair object ( you would have to write pair class ) and you would also have to define the comparator function for it so as the PriorityQueue class can compare two different pairs.