Under This Job

Process of dequeuing an empty queue is called – Data Structures and Algorithm (DSA) Queue :-


A queue is an abstract data structure, somewhat similar to a stack. Unlike the stack, a line is opened at both ends of it.

One end is always used to insert data (enqueue) and the other to extract data (dequeue).

The queue follows the first-in-first-out methodology, that is, the first stored data item will be accessed first.

With MCQ data structure and algorithms (DSA) as well as the most frequently asked answers in both the company’s placement preparation and college semester exams.


FAQs About Data Structures and Algorithm (DSA) Queue MCQ’S Question Set 2

 

Q- Process of inserting an elements at the end of queue is known as? 

a)Dequeueb) Enqueuec)Pushd) PopAns:b(Enqueue) 

Q- Returns the element at front without removing it 

a) Enqueueb) Dequeuec) int Front() d) None of theseAns:c(int Front()) 

Q- The maximum size of the queue ?

a) can be changedb) cannot be changec) independentd) None of theseAns:b(cannot be changed) 

Q- What is the most appropriate data structure to print elements of queue in reverse order?

a) Stackb) Listc) Sortingd) None of theseAns:a(Stack) 

Q- Process of Dequeuing an empty queue is called

a) Underflowb) Overflowc) Skip listsd) none of theseAns:a(Underflow) 

Q- Process of Enqueuing an element in a full queue is called

a) Underflowb) Overflowc) Skip listsd) None of theseAns:b(Overflow) 

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

a) Rear=MAX_SIZE-1b) Front=(rear+1)mod MAX_SIZEc) Front=rear+1d) Rear=frontAns:a(Rear=MAX_SIZE-1

Q- What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?

a) θ (n)b) θ (n + k)c) θ (nk)d) θ (n2)Ans:a(∅(n)) 

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

a) ABCDb) DCBAc) DCABd) ABCDAns:a(ABCD) 

Q- A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a ?

a) Queueb) Stackc) Treed) Linked listAns:a(Queue) 

Q- Define circular queue ?

A circular queue is one in which a new element is inserted at the first place of the queue when the last location of the queue is complete.

Q- Queue where insertion and deletion performed from both ends ?

a) Circular queueb) Doubly circular queuec) Double Ended queued) none of theseAns:c(Double ended queue) 

Q- What is input restricted dequeue? 

In input restricted DQ, entry can only be done in the rear end while deletion can be done in both the rear and front end.

Q- Name dequeue in which insertion can be done from bith rear and front end ?

a) Output restricted dequeueb) Input restricted dequeuec) Double ended queued) none of theseAns:a(Output restricted dequeue) 

Q- Which function is used to return the value of first element without dequeueing it? 

a) peek() b) typedefc) idd) none of theseAns:a(peek()) 

Q- Define priority queue ?

A priority queue is another form of queue structure. Here, each element is assigned a value, which is called the priority of the element.

Q- Name few ways of implementing structure of a priority queue ?

Using a simple/circular arrayMulti-queue implementationUsing a double linked listUsing a heap tree

Q- List few applications of queue.

1- It is used to schedule jobs to be processed by the CPU.2- Surving request on the single shared resources like a printer, cpu, scheduling, etc. 3- Breadth first search[BFS] uses a queue data structure to find an element from a graph.

Q- push() and pop() functions are found in

a) queuesb) listsc) stacksd) treesAns:c(stacks) 

Q- Minimum number of queues required for priority queue implementation?

a) 5b) 4c) 3d) 2Ans:d(2) 


Queue Representation :-

As we now understand that in the queue, we reach both ends for different reasons. The following diagram below tries to explain the queue representation in the data structure –

 

 

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Career Swift 2019 | Proudly hosted on Fliar BI