Heaps doubt iteration

Is there anyway you can iterate through priority queue stl ?

@vidyajaykushwaha
The only way is to pop the elements one by one and read them. If you wish to keep your heap intact while reading the data through it , you can either store this data in a array/vector while you read it and when you are done reading , push the data from your array/vector back into the heap again.
Or you can simply create a copy of the heap and do as you wish with it while your original heap remains intact.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.