If I am implementing a priority queue, does every object in the queue need an individual priority or can I set I multiple things to the same priority in which case it defaults to FIFO? For example if I want to push instructions to a queue, can I have a series of instructions which operate at say priorty 1 and are executed in a FIFO manner but at some point push an instruction with priority 10 and it will automatically be the next thing to be popped? This would be in case I wanted to stop my instructions or do some subset of instructions before I continue with the regular priority 1 instructions.
thanks



LinkBack URL
About LinkBacks



But keep in mind that there are many different ways to create a priority queue, and building this functionality directly into the data structure may not be practical for some of them. Fortunately, you can fake it pretty easily.