An office printer must process print jobs in exactly the order in which employees submitted them, with no job allowed to jump ahead of an earlier one. Which data structure is the most appropriate choice for holding the pending jobs, and why?
A queue, because elements are removed in exactly the order in which they were added
A stack, because the most recently added element is always processed first
A binary search tree, because elements are always kept in sorted order of their keys
A hash table, because any element can be located directly through its key
The verified answer and full solution are one login away
Every answer here is machine verified, with a step-by-step solution that teaches the method. Your login also unlocks a 7-question mock preview in the real exam interface.
Log in to see the answerMore data structures questions