I have three doubly linked list queues and I need to sort them based on a variable that each object has namely its job length. I am attempting to code for a shortest job first processing program. I already have most of the program complete but now I need to sort the queues so the shortest jobs are first in line.

What would be the best/easiest/least amount of code way to sort these queues?

thank you!

Recommended Answers

All 2 Replies

The easiest way would be to maintain a sorted list as items are entered, then have the list take on queue behavior after all items have been entered. Is this a suitable solution?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.