Queue using Array and Linked List MCQs

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. 

Answer= First In First Out


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-. 

Answer= (rear+1) % CAPACITY


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. 

Answer= overflow


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

A. O(logn). 

B. O(nlogn). 

C. O(n). 

D. O(1). 

Answer= 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. 

Answer= effective usage of memory


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). 

Answer= O(n)


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?. 

A. At the head of link list. 

B. At the centre position in the link list. 

C. At the tail of the link list. 

D. None of the mentioned. 

Answer= At the tail of the link list


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. 

Answer= Only rear pointer


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. 

Answer= AVAIL


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

A. At the head of link list. 

B. At the centre position in the link list. 

C. At the tail of the link list. 

D. None of the mentioned. 

Answer= At the head of link list


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. 

C. LINK is empty. 

D. None of the mentioned. 

Answer= FRONT is null


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

A. Underflow. 

B. Overflow. 

C. Front value. 

D. Rear value. 

Answer= Overflow


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

A. Underflow. 

B. Overflow. 

C. Front value. 

D. Rear value. 

Answer= Underflow


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. 

Answer= All of the mentioned


Q18. Which of the following is not an application of priority queue?. 

A. Huffman codes. 

B. Interrupt handling in operating system. 

C. Undo operation in text editors. 

D. Bayesian spam filter. 

Answer= Undo operation in text editors

Previous Post Next Post