No student devices needed. Know more
30 questions
A queue is a ______
FIFO (First In First Out) list
LIFO (Last In First Out) list
Ordered array
Linear tree
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
ABCD
In linked list implementation of a queue, where does a new element be inserted?
At the head of linked list
At the tail of the linked list
At the centre position in the linked list
At the head and tail in the linked list
A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The insertion of next element takes place at the array index.
10
9
7
0
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?
Only front pointer
Only rear pointer
Both front and rear pointer
None of the front and rear pointer
In which data structure element is inserted at one end called Rear and deleted at other end called Front.
Linked list
Stack
Queue
Tree
Insertion and Deletion operation in Queue is known as ?
Push and Pop
Enqueue and Dequeue
Insert and Delete
None
For the linked list implementation of the queue, where are the enqueue and dequeues performed?
Enqueue in front of the first element, dequeue the first element
Enqueue after the last element, dequeue the last element
Enqueue after the last element, dequeue the first element
Enqueue in front of the first element, dequeue the last element
Circular Queue is also called ________
Square Buffer
Ring Buffer
Rectangle Buffer
Curve Buffer
Suppose we have a circular array implementation of the queue, with ten items in the queue stored at data[2] through data[11], the current capacity is 12. Where does the insert method place the new entry in the array?
data[1]
data[0]
data[12]
data[11]
Queues and Stacks can be implemented using either arrays or linked lists.
True
False
FIFO means
First In Fast Out
Fast In Fast Out
Fast In First Out
First In First Out
A line in a grocery store represents a
Stacks
Linked list
Queues
Array
A ______ is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
Queue linked list
Stacks linked list
Suppose we have a circular array implementation of a queue with 2 items. the front = 0 and back = 1. The max capacity of the array is MAX_SIZE = 2. What will be the value of front and back after a dequeue operations
front = 1 back = 1
front = 1 back = 2
front = 0 back = 2
front = 0 back = 1
In Queue, Insertion & Deletion take place at ________________.
same end
first end
last end
different end
One difference between a queue and a stack is:
Queues require dynamic memory, but stacks do not
Queues use two ends of the structure; stacks use only one.
Stacks require dynamic memory, but queues do not.
Stacks use two ends of the structure, queues use only one.
If the numbers 5, 10, 3, 42 are enqueued onto a queue in that order, what does dequeue return?
5
10
3
42
A queue of characters currently contained A, B, C, D. What would be the contents of queue after the following operation DELETE, ADD W, ADD X, DELETE, ADD Y.
A, B, C, W, Y
A, B, C, D, W
W, Y, X, C, D
C, D, W, X, Y
application of queue in real life.
threads
waiting in line
job scheduling
In linked list implementation of a queue, from where is the item deleted?
At the center position in the link list
At the tail of the link list
At the head of link list
None of the mentioned
In linked list implementation of a queue, the important condition for a queue to be empty is?
FRONT is null
LINK is empty
REAR is null
None of the mentioned
Let the following circular queue can accommodate maximum six elements with the following data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
What will happen after ADD O operation takes place?
front = 3 rear = 5
queue = L, M, N, O, ___
front = 2 rear = 5
queue = ______; L, M, N, O, ___
front = 3 rear = 4
queue = ______; L, M, N, O, ___
Front = 2 rear = 4
queue = L, M, N, O, ___
A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The insertion of next element takes place at the array index ____.
0
7
9
10
What is the reason for using a "circular queue" instead of a regular one?
running time of enqueue() is improved
reuse empty spaces
you can traverse all the elements more efficiently
none of the above
If front=rear ,then the queue is?
full
empty
overflow
underflow
Queue can be implemented using a list?
True
False
A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Rear" index pointer point?
0
1
2
3
A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point?
Bert
Cynthia
Cedric
Albert
Suppose you have the following series of queue operations.
q = Queue();
q.enqueue('hello');
q.enqueue('dog');
q.enqueue(3);
q.dequeue();
What items are left on the queue?
'hello', 'dog'
'hello', 3
'dog', 3
'hello', 'dog', 3
Explore all questions with a free account