Question: Suppose we have implemented the Queue ADT as a singly-linked-list with head and tail pointers and no sentinels. Which of the following best describe the




Suppose we have implemented the Queue ADT as a singly-linked-list with head and tail pointers and no sentinels. Which of the following best describe the tightest running times for the functions enqueue and dequeue, assuming there are O(n) items in the list, and that the front of the queue is at the head of the list? O O(1) for both. O O(n) for both O O(1) for enqueue and O(n) for dequeue. 0 0(n) for enqueue and 0(1) for dequeue. O None of the options is correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
