The Gateway to Computer Science Excellence
0 votes

Consider following Scenario -

  1. The five items : P,Q,R,S and T are inserted into stack A one after other starting from T in reverse order
  2. The stack is popped three times and each element is inserted into another stack B.
  3. Then two elements are deleted from the stack B and pushed back onto the stack A.

What are the topmost elements of stack A and Stack B respectively?

  1. RP
  2. QR
  3. QP
  4. RQ
in Programming by Veteran (75k points) | 27 views

Please log in or register to answer this question.


Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,405 answers
105,466 users