Recall & Review
beginner
What does 'enqueue' mean in the context of a queue data structure?
Enqueue means adding an element to the end (rear) of the queue.
Click to reveal answer
beginner
Why is a linked list a good choice to implement a queue?
Because it allows efficient addition at the end and removal from the front without shifting elements.
Click to reveal answer
beginner
In enqueue operation using a linked list, where is the new node added?
The new node is added at the rear (tail) of the linked list.
Click to reveal answer
intermediate
What pointers are updated during enqueue in a linked list queue?
The rear pointer is updated to point to the new node; if the queue was empty, the front pointer also points to the new node.
Click to reveal answer
beginner
What happens if you enqueue into an empty linked list queue?
Both front and rear pointers are set to the new node, as it is the only element.
Click to reveal answer
What is the time complexity of enqueue operation in a linked list implementation of a queue?
✗ Incorrect
Enqueue adds a node at the rear in constant time because we keep a pointer to the rear.
When enqueuing a new node in a linked list queue, which pointer must be updated?
✗ Incorrect
Rear pointer always updates to new node; front pointer updates only if queue was empty.
What happens if you forget to update the rear pointer during enqueue?
✗ Incorrect
Rear pointer must point to the last node; otherwise, new nodes are not linked correctly.
Which of these is NOT true about enqueue in linked list?
✗ Incorrect
Linked list enqueue does not require shifting nodes; it just links new node at the end.
If the queue is empty, what should front and rear pointers be after enqueue?
✗ Incorrect
When queue is empty, both front and rear point to the new node after enqueue.
Explain step-by-step how enqueue works in a linked list based queue.
Think about what pointers change and where the new node goes.
You got /5 concepts.
Describe how you would handle enqueue operation if the queue is initially empty.
Focus on initializing pointers for the first element.
You got /4 concepts.