adplus-dvertising
frame-decoration

Question

The following sequence of the operations is performed on a stack PUSH(10), PUSH(20), POP, PUSH(10), PUSH(20), POP, POP, POP, PUSH(20), POP the sequence of values popped out is

a.

20, 10, 20, 10, 20

b.

20, 20, 10, 10, 20

c.

10, 20, 20, 10, 20

d.

20, 20, 10, 20, 10

Answer: (b).20, 20, 10, 10, 20

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. The following sequence of the operations is performed on a stack PUSH(10), PUSH(20), POP, PUSH(10), PUSH(20), POP, POP, POP, PUSH(20), POP the sequence of values popped out is

Similar Questions

Discover Related MCQs

Q. The time complexity of comparison based sorting algorithm is

Q. Adjacency matrix for a digraph is

Q. The time required to insert an element in a stack with linked list implementation is

Q. The time required to search an element in a binary search tree having n element is

Q. Merge sort uses

Q. For merging two sorted lists of sizes m and n to a sorted list of size m+n, we require Comparisons of

Q. The search concept used in associative memory is

Q. Suppose we want to arrange the n numbers stored in an array such that all negative value before all positive ones, minimum number of exchanges required in the worst case

Q. The average time required to perform a successful sequential search for an element in an array A(1:n) is given by

Q. How many comparisons are needed to sort an array of length 5 if a straight selection sort is used and array is already in opposite order?

Q. Using the standard algorithm, what is the time required to determine that a number n is prime?

Q. If B is a circuit matrix of a graph with k components, e edges and n vertices, the rank of B is

Q. In a complete binary tree of n nodes, how far all the most distant two nodes? Assume each in the path counts as 1. Assume log (n) is log base 2.

Q. The number of nodes in a full binary till of depth 4 is

Q. The ...................sort algorithms works by comparing adjacent array that are out of order.

Q. Which of the following is the average number of key comparison done by sequential in the Successful case?

Q. Which of the following is not good for linked list?

Q. A complete binary tree of level 5 has how many nodes?

Q. High level languages are not concerned with the computers but with

Q. Which sort will operate in quadratic time relative to the number of elements in the array (on avg) ?