I wish to implement a priority queue and I need to create it with structures, as in I will be inserting structures into the queue and I wish to keep it sorted(ascending order) it according to one of the structure elements.
How can this be done?
Any pointers will be appreciated!
eg: I have :
I want to keep my queue of structures sorted as per lowest cost to highest cost.