Draft - Backend Work Queue and Priority Scheduling
Authoring skeleton - backend focus (CS113 backend collections)
Three short topics
- FIFO queue as a backend job/review queue.
- Priority ordering and an explicit tie policy.
- Stack vs queue vs deque: choose by the order the feature needs.
PBL context
Compare FIFO task handling with priority scheduling for a backend queue and explain the ordering invariant. AssignmentQueue is a context to observe, not a prepared exercise.
Backend layers to author
- Library Queue/Deque version of a work queue.
- Add priorities with a comparator and a documented tie rule.
- Trace enqueue/dequeue operations and state the invariant.
- Lead-in to the heap-priority-queue draft (from-scratch heap).
Evidence checklist to author
Test empty dequeue, one item, equal priorities, and reversed input; verify order and the invariant after each operation. Separate library use from from-scratch competence.
Publication checklist
Complete examples, a CodeRunner exercise, and tests before removing the draft/hide flags, enabling submissions, or confirming the course and week.
Code Runner Challenge
Authoring draft - backend work queue exercise is not ready
View IPYNB Source
// CODE_RUNNER: Authoring draft - backend work queue exercise is not ready
public class WorkQueueDraft {
public static void main(String[] args) {
throw new UnsupportedOperationException("Draft: author queue operations and tests before publication.");
}
}
WorkQueueDraft.main(null);
Lines: 1
Characters: 0
Output
Click "Run" in code control panel to see output ...