retagged by
4,968 views
4 votes
4 votes

Consider the following operations performed on a stack of size 5:

Push (a); Pop(); Push(b); Push(c); Pop();

Push(d); Pop(); Pop(); Push(e)

Which of the following statements is correct?

  1. Underflow occurs
  2. Stack operations are performed smoothly
  3. Overflow occurs
  4. None of the above
retagged by

1 Answer

2 votes
2 votes
Given stack size = 5

Operation                                Stack contents

push(a)                                            a

pop()                                                -

push(b)                                            b

push(c)                                            b,c

pop()                                               b

push(d)                                           b,d

pop()                                              b

pop()                                               -

push(e)                                          e       

Option B.
edited by
Answer:

Related questions

3 votes
3 votes
2 answers
1
go_editor asked Aug 16, 2016
3,736 views
Which of the following is not an inherent application of stack?Implementation of recursionEvaluation of a postfix expressionJob schedulingReverse a string
3 votes
3 votes
3 answers
2
go_editor asked Aug 16, 2016
14,261 views
Suppose you are given a binary tree with n nodes, such that each node has exactly eiter zero or two children. The maximum height of the tree will be$\frac{n}{2}-1$$\frac{...
7 votes
7 votes
1 answer
3
go_editor asked Aug 14, 2016
5,374 views
A clique in a simple undirected graph is a complete subgraph that is not contained in any larger complete subgraph. How many cliques are there in a graph shown below?2456...
3 votes
3 votes
2 answers
4
go_editor asked Aug 14, 2016
5,559 views
The number of different spanning trees in complete graph, $K_4$ and bipartite graph, $K_{2,2}$ have ____ and ___ respectively.14, 1416, 1416, 414, 4