Stacks and Queues
Quizsummary
0 of 11 questions completed
Questions:
 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
Information
Basic questions on Stacks and queues.
You must specify a text. 

You must specify an email address. 
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 11 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
 Stacks and Queues 0%
 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 Answered
 Review

Question 1 of 11
1. Question
1 pointsIdentify the data structure which allows deletions at both ends of the list but insertion at only one end.
Correct
Incorrect

Question 2 of 11
2. Question
1 pointsThe initial configuration of the queue is a,b,c,d (a is the front end). To get the configuration d,c,b,a one needs a minimum of ?
Correct
Incorrect

Question 3 of 11
3. Question
1 pointsWhat is the condition for a circular queue to be full?
Correct
Incorrect

Question 4 of 11
4. Question
1 pointsWhat will be the value of top, if there is a stack of size 5?
Correct
Incorrect

Question 5 of 11
5. Question
1 pointsFollowing is C like pseudo code of a function that takes a Queue as an argument, and uses a stack S to do processing.
void fun(Queue *Q) { Stack S; // Say it creates an empty stack S // Run while Q is not empty while (!isEmpty(Q)) { // deQueue an item from Q and push the dequeued item to S push(&S, deQueue(Q)); } // Run while Stack S is not empty while (!isEmpty(&S)) { // Pop an item from S and enqueue the poppped item to Q enQueue(Q, pop(&S)); } }
What does the above function do in general?
Correct
Incorrect
The function takes a queue Q as an argument. It dequeues all items of Q and pushes them to a stack S. Then pops all items of S and enqueues the items back to Q. Since stack is LIFO order, all items of queue are reversed.

Question 6 of 11
6. Question
1 pointsWhich one of the following is an application of Queue Data Structure?
Correct
Incorrect

Question 7 of 11
7. Question
1 pointsHow many stacks are needed to implement a queue? Consider the situation where no other data structure like arrays, linked list is available to you.
Correct
Incorrect

Question 8 of 11
8. Question
1 pointsHow many queues are needed to implement a stack? Consider the situation where no other data structure like arrays, linked list is available to you.
Correct
Incorrect

Question 9 of 11
9. Question
1 pointsA priority queue can be efficiently implemented using which of the following data structures? Assume that the number of insert and peek (operation to see the current highest priority item) and extraction (remove the highest priority item) operations are almost same.
Correct
Incorrect

Question 10 of 11
10. Question
1 pointsSuppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation 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
Correct
Incorrect

Question 11 of 11
11. Question
1 pointsA PriorityQueue is implemented as a MaxHeap. Initially, it has 5 elements. The levelorder traversal of the heap is: 10, 8, 5, 3, 2. Two new elements ‘1’ and ‘7’ are inserted in the heap in that order. The levelorder traversal of the heap after the insertion of the elements is:
Correct
Incorrect