how to keep a check for the number who is getting inserted again ?
How to check whether a number is already in heap
hello @kingshuk441
A priority_queue only has 2 operations defined: insert at a given priority, and retrieve the item with the highest priority.it dont support any other operation.
if u want to keep track of inserted element then u can u set or similar datastructure
plz check if it is correct or not if not plz make changes in it
@kingshuk441
store coordinates of elements as well in ur priority queue. and use them to insert next unvisited element.
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.