Array is a particular kind of data structure that can be used to implement various kinds of queue structures. Use of arrays is sufficient anytime its permissible to store data in contiguous memory locations. An array data structure can help implement simple queue, priority queue and double ended queue structures. This Queue Using Array Program MCQs PDF is designed to help you practice questions on array data structures. These Queue Using Array Program MCQs and Answers will help you prepare for any exam including GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.
Queue Using Array Program MCQs and Answers
1. 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)
2. 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) Last In Last Out
Answer: First In First Out
3. 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
4. What is the term for inserting into a full queue known as?
a) overflow
b) underflow
c) null pointer exception
d) program won’t be compiled
Answer: overflow
5. What is the time complexity of enqueue operation?
a) O(logn)
b) O(nlogn)
c) O(n)
d) O(1)
Answer: O(1)
6. What is the need for a circular queue?
a) effective usage of memory
b) easier computations
c) to delete elements based on priority
d) implement LIFO principle in queues
Answer: effective usage of memory
More Questions on Abstract Data Types (Data Structure)
Categories: Abstract Data Types