Circular Queue MCQ Quiz in मराठी - Objective Question with Answer for Circular Queue - मोफत PDF डाउनलोड करा
Last updated on Mar 20, 2025
Latest Circular Queue MCQ Objective Questions
Top Circular Queue MCQ Objective Questions
Circular Queue Question 1:
Suppose a circular queue of capacity (n - 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variable respectively. Initially, REAR = FRONT = 0. The conditions to detect queue empty and queue full are
Answer (Detailed Solution Below)
EMPTY : REAR == FRONT
FULL : (REAR + 1) mod n == FRONT
Circular Queue Question 1 Detailed Solution
The Correct answer is EMPTY : REAR == FRONT and FULL : (REAR + 1) mod n == FRONT
Key Points A circular queue is a queue whose last position is connected back to the first position.
- ENQUEUE – It is the operation to insert elements into the queue.
- DEQUEUE – It is the operation to delete elements from the queue.
After inserting an element in the last position, the next element again gets inserted into the first position.
EXPLANATION:
- Given, Rear = Front = 0
- Here, the Rear is used to insert elements & the front is used to delete elements.
- To check full condition in queue:
- (Rear + 1) % n == Front
- Example: Consider queue is full that means Rear = 6, front = 0, n = 7
- (6+1) % 7 = 7 % 7 = 0
- To check empty condition in queue:
- Rear == Front
- Example: Consider queue is empty that means Rear = 0, front = 0, n = 7
- Rear = Front = 0
Hence, the correct answer is “option 1”.
Circular Queue Question 2:
A. Backtracking | P. Array |
B. Breadth first search | Q. Stack |
C. Reverse polish notation | R. Queue |
D. Vectors | S. Heap |
Match the columns in the table.
Answer (Detailed Solution Below)
Circular Queue Question 2 Detailed Solution
Backtracking requires stack, for example in depth first search.
Breadth first search uses queue.
Reverse polish notation, expressions can be represented in prefix, postfix or infix notations and conversion from one form to another may be accomplished using a stack.
Vectors are implemented using arrays.
Circular Queue Question 3:
Suppose a circular queue of capacity (n −1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
Answer (Detailed Solution Below)
Circular Queue Question 3 Detailed Solution
The correct answer is "option 1".
CONCEPT:
A circular queue is a queue whose last position is connected back to the first position.
ENQUEUE – It is the operation to insert elements into the queue.
DEQUEUE – It is the operation to delete elements from the queue.
After inserting an element in the last position, the next element again gets inserted into the first position.
EXPLANATION:
Given, Rear = Front = 0
Here, the Rear is used to insert elements & the front is used to delete elements.
To check full condition in queue:
(Rear + 1) % n == Front
Example: Consider queue is full that means Rear = 6, front = 0, n = 7
(6+1) % 7 = 7 % 7 = 0
To check empty condition in queue:
Rear == Front
Example: Consider queue is empty that means Rear = 0, front = 0, n = 7
Rear = Front = 0
Hence, the correct answer is “option 1”.
Circular Queue Question 4:
With respect to deque which of the following is true?
Answer (Detailed Solution Below)
Circular Queue Question 4 Detailed Solution
Deque:
- Double ended queue
- Generalized version of queue
- Allows to insert and delete at both front and rear ends.
Hence option 4 is the correct answer.
Circular Queue Question 5:
With respect to deque which of the following is true?
Answer (Detailed Solution Below)
Circular Queue Question 5 Detailed Solution
Deque:
- Double ended queue
- Generalized version of queue
- Allows to insert and delete at both front and rear ends.
Hence option 4 is the correct answer.
Circular Queue Question 6:
Which one of the following is a Mendable priority queue?
Answer (Detailed Solution Below)
Circular Queue Question 6 Detailed Solution
Concept:
A leftist heap is a modification priority queue implemented with variant of binary heap . A leftist heap is not always balanced as compared to binary heap.
Explanation:
A leftist heap maintains two properties one is it maintains min heap property and it is heavy on left side.
Leftist heap property requires that for every node x with children L and R, rank (L) >= rank (R), where rank(x) is the number of nodes in the right of x. In a leftist heap with n entries, the rank of root node is at most log2(n+1).
Circular Queue Question 7:
Which of the following data structures allows both addition and deletion of items from either end?
Answer (Detailed Solution Below)
Circular Queue Question 7 Detailed Solution
Double ended queue:
it is queue data structure in which deletion and insertion can be possible from either end. We can insert at both front and rear end and can delete from both the ends.
Priority queue:
A priority queue is a special type of queue in which each element is associated with a priority and is served according to its priority.
Stack:
Stack is a data structure which follows a particular order in which the operations are performed. The order stack follows is LIFO (Last in first out).
Queue:
Queue is a data structure which follows the order FIFO (First in First out).Circular Queue Question 8:
What is the time taken to insert and delete an element in the queue implemented using an array if front points to the position where insertion is done and rear points to the position from where deletion is done?
Answer (Detailed Solution Below)
Circular Queue Question 8 Detailed Solution
Since we have the pointers for the ends where insertion and deletion can be done, therefore, constant time will be taken to insert and delete an element from the queue.
Hence, option 3 i.e. O(1), O(1) is the correct answer.
Circular Queue Question 9:
Which of the following statements is false?
Answer (Detailed Solution Below)
Circular Queue Question 9 Detailed Solution
The correct answer is option 4.
It should be corrected as Time taken to delete an element from a queue is O(1).
Circular Queue Question 10:
Consider the following implementation of of stack:
#include
#define size 4
char s[size];
int top = -1;
void push(char*, char);
char pop(char*);
int main( )
{
char a,b,c,d;
push(s,a);
push(s,b);
push(s,c);
push(s,pop(s));
printf("%c",pop(s));
return(0);
}
void push(char* a, char b)
{
if(top==size) { printf("overflow");}
else{ a[++top] = b; }
}
char pop(char* a) {
if(top==-1) {printf("underflow");}
else { return(a[top]);}
top--;
}
Value printed by above code is:
Answer (Detailed Solution Below)
Circular Queue Question 10 Detailed Solution
The correct answer is option 3.
Concept:
Stack:
A stack is a linear data structure in which operations are done in a specific order. The order might be LIFO (last-in, first-out) or FILO (first in, first out) (First In Last Out).
Explanation:
The c snippet is, The main function( ) is,
char a,b,c,d;
push(s,a);
push(s,b);
push(s,c);
push(s,pop(s));
printf("%c",pop(s));
Hence the correct answer is c.