5,271 views
Consider the following sequence of operations on an empty stack.$$\textsf{push}(54);\textsf{push}(52);\textsf{pop}();\textsf{push}(55);\textsf{push}(62);\textsf{s}=\textsf{pop}();$$Consider the following sequence of operations on an empty queue.$$\textsf{enqueue}(21);\textsf{enqueue}(24);\textsf{dequeue}();\textsf{enqueue}(28);\textsf{enqueue}(32);\textsf{q}=\textsf{dequeue}();$$ The value of $\textsf{s+q}$ is ___________.

### 1 comment

……………………….

Stack:

• Push $54,$ push $52,$ pop (remove top element of stack)
• Now stack $54$ (remove 52), push $55,$ push $62,$ pop
• Now top element is $62$ (remove $62$ as $S$)
• $S=62$

Queue

• Enqueue $21,$ Enqueue $24$ dequeue (remove first element of queue)
• Now queue $24$ (remove $21$), Enqueue $28,$ Enqueue $32,$ dequeue
• Starting element is $24$ (remove $24$ as $Q$)
• $Q = 24$

$S+Q = 62+24 = 86$

by

ANS IS 86

JUST SEE BASIC OPERATIONS OF STACK AND QUEUE.

by

s = 62

p = 24

s+p = 62+24  = 86

by

1
9,363 views