Top 50+ Solved Linear Data Structures -Stacks and Queues MCQ Questions Answer

From 31 to 45 of 46

Q. A normal queue, if implemented using an array of size MAX_SIZE, gets full when

a. Rear = MAX_SIZE – 1

b. Front = (rear + 1)mod MAX_SIZE

c. Front = rear + 1

d. Rear = front

  • a. Rear = MAX_SIZE – 1

Q. Queues serve major role in

a. Simulation of recursion

b. Simulation of arbitrary linked list

c. Simulation of limited resource allocation

d. Simulation of heap sort

  • c. Simulation of limited resource allocation

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

a. Array

b. List

c. Heap

d. Tree

  • d. Tree

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

  • c. Undo operation in text editors

Q. What is the time complexity to insert a node based on key in a priority queue?

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • c. O(n)

Q. What is not a disadvantage of priority scheduling in operating systems?

a. A low priority process might have to wait indefinitely for the CPU

b. If the system crashes, the low priority systems may be lost permanently

c. Interrupt handling

d. Indefinite blocking

  • c. Interrupt handling

Q. Which of the following is not an advantage of priority queue?

a. Easy to implement

b. Processes with different priority can be efficiently handled

c. Applications with differing requirements

d. Easy to delete elements in any case

  • d. Easy to delete elements in any case

Q. What is a dequeue?

a. A queue with insert/delete defined for both front and rear ends of the queue

b. A queue implemented with a doubly linked list

c. A queue implemented with both singly and doubly linked lists

d. A queue with insert/delete defined for front side of the queue

  • a. A queue with insert/delete defined for both front and rear ends of the queue

Q. What are the applications of dequeue?

a. A-Steal job scheduling algorithm

b. Can be used as both stack and queue

c. To find the maximum of all sub arrays of size k

d. To avoid collision in hash tables

  • d. To avoid collision in hash tables

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

  • b. First In First Out

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

  • b. (rear+1) % CAPACITY

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

  • a. overflow

Q. What is the time complexity of enqueue operation?

a. O(logn)

b. O(nlogn)

c. O(n)

d. O(1)

  • d. O(1)

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

  • a. effective usage of memory
Subscribe Now

Get All Updates & News