Queue using Array and Linked List MCQs

Q1. Which of the following properties is associated with a queue?.

A. First In Last Out.

B. First In First Out.

C. Last In First Out.

D. None of the mentioned.

Q2. In a circular queue, how do you increment the rear end of the queue?.

A. rear++.

B. (rear+1) % CAPACITY.

C. (rear % CAPACITY)+1.

D. rear-.

Q3. What is the term for inserting into a full queue known as?.

A. overflow.

B. underflow.

C. null pointer exception.

D. all of the mentioned.

Q4. What is the time complexity of enqueue operation?.

A. O(logn).

B. O(nlogn).

C. O(n).

D. O(1).

Q5. What is the need for a circular queue?.

A. effective usage of memory.

B. easier computations.

C. all of the mentioned.

D. none of the mentioned.

Q6. What is the space complexity of a linear queue having n elements?.

A. O(n).

B. O(nlogn).

C. O(logn).

D. O(1).

Q7. In linked list implementation of queue, if only front pointer is maintained, which of the following operation take worst case linear time?.

A. Insertion.

B. Deletion.

C. To empty a queue.

D. Both Insertion and To empty a queue.

Answer= Both Insertion and To empty a queue

Q8. In linked list implementation of a queue, where does a new element be inserted?.

B. At the centre position in the link list.

C. At the tail of the link list.

D. None of the mentioned.

Q9. In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into a NONEMPTY queue?.

A. Only front pointer.

B. Only rear pointer.

C. Both front and rear pointer.

D. None of the mentioned.

Q10. In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into EMPTY queue?.

A. Only front pointer.

B. Only rear pointer.

C. Both front and rear pointer.

D. None of the mentioned.

Answer= Both front and rear pointer

Q11. In case of insertion into a linked queue, a node borrowed from the __________ list is inserted in the queue..

A. AVAIL.

B. FRONT.

C. REAR.

D. None of the mentioned.

Q12. In linked list implementation of a queue, from where is the item deleted?.

B. At the centre position in the link list.

C. At the tail of the link list.

D. None of the mentioned.

Q13. In linked list implementation of a queue, the important condition for a queue to be empty is?.

A. FRONT is null.

B. REAR is null.

D. None of the mentioned.

Q14. The essential condition which is checked before insertion in a linked queue is?.

A. Underflow.

B. Overflow.

C. Front value.

D. Rear value.

Q15. The essential condition which is checked before deletion in a linked queue is?.

A. Underflow.

B. Overflow.

C. Front value.

D. Rear value.

Q16. Which of the following is true about linked list implementation of queue?.

A. In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.

B. In push operation, if new nodes are inserted at the beginning, then in pop operation, nodes must be removed from the beginning.

C. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from end.

D. None of the mentioned.

Answer= In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end

Q17. With what data structure can a priority queue be implemented?.

A. Array.

B. List.

C. Heap.

D. All of the mentioned.