MCQ on Data Structure – Stack and Queue

MCQ on stack and queue data structure. The concept of Stack and Queue data structure is very important in computer science. In my previous post i have discussed following things.

Stack program in C using Array.

Queue data structure and their implementation.

The purpose of this objective questions is to test how well you understand the concept of stack and queue.

Stack vs Queue

1. Stack and Queue both are linear data structure. In Stack insertions and deletions are allowed only at one end that is why it also called as LIFO (Last In First Out).

In queue insertion are performed on one end (Rear) and deletion is performed on other end (Front) it is also known as FIFO (First In First Out).

Subscribe Our Tutorials

Get Latest Updates on Facebook

2. In Stack, insertion operation is known as Push whereas deletion operation is known as Pop.

In queue, insertion operation is known as Enqueue whereas deletion operation is known as Dequeue.

3.

Application of Stack

a) In recursive function.

b) When function is called.

c) Expression conversion such as – Infix to Postfix ,Infix to Prefix, Postfix to Infix,Prefix to Infix.

Application of Queue

1) Serving requests of a single shared resource (printer, disk, CPU).

2) Transferring data asynchronously (data not necessarily received at same rate as sent) between two processes (IO buffers), e.g., pipes, file IO, sockets.

3) In consumer producer problem. When a resource is shared among multiple consumers. Examples include CPU scheduling, Disk Scheduling.

Stack and Queue MCQ

Congratulations - you have completed Stack and Queue MCQ.You scored %%SCORE%% out of %%TOTAL%%.Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1
The term Push and Pop is related to
A
Queue
B
Stack
Hint:
In stack push means insert an element in a stack. Pop means delete an element. Stack Implementation
C
Both
D
None
Question 2
Choose correct output for the following sequence of operations.
push(5)
push(8)
pop
push(2)
push(5)
pop
pop
pop
push(1)
pop
A
8 5 2 5 1
Hint:
Stack worked on LIFO (Last in First out) principle.
B
8 5 5 2 1
C
8 2 5 5 1
D
8 1 2 5 5
Question 3
In which data structure element is inserted at one end called Rear and deleted at other end called Front.
A
Stack
B
Queue
Hint:
In queue element is inserted at one end called rear and deleted at other end called front. Queue Implementation
C
Both
D
Binary Tree
Question 4
Stack can be implemented using _________ and ________ ?
A
Array and Binary Tree
B
Linked List and Graph
C
Array and Linked List
D
Queue and Linked List
Question 5
Postfix form of following expression.
D + (E * F)
A
EF * D+
B
DEF * +
C
DEF +*
D
EFD *+
Question 6
When function calls another function then the details of previous function are stored in Stack ?
A
True
B
False
Question 7
Insertion and Deletion operation in Queue is known as ?
A
Push and Pop
B
Enqueue and Dequeue
C
Insert and Delete
D
None
Question 8
Stack data structure cannot be used for
A
Implementation of Recursive Function
B
Allocation Resources and Scheduling
C
Reversing string
D
Evaluation of string in postfix form
Question 8 Explanation: 
Queue data structure is used for allocating resources and scheduling.
Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 8 questions to complete.

Reference

WebRewrite

About WebRewrite

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.
Tagged , , . Bookmark the permalink.