1,070 views
1 1 vote

pls explain this;i never get its explanation on GO!

1 Answer

Best answer
0 0 votes

                                                                                                                                                             

Best Case[When top m element to be deleted]                                                                                          

 Push        n+m[ n Pushes in S1 and m pushes in S2]             Pop    m+m[m from each Stack]

 

Worst Case[When last m element to be deleted]          

Push            n+n[All element have to insert in each stack]    Pop    n+m[All from Stack1 ,m element from Stack2]                               

So,  n+m<=X<=2n and 2m<=Y<=n+m  hence Option (A) is answer.

selected by
Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
267
267 views
IT_021_Manish_Kumar asked Dec 6, 2025
267 views
If definition of complete binary tree is not given in the questions then what should by default I need to consider ?
1 1 vote
1 1 answer
782
782 views
Pankaj_Kumar asked Nov 28, 2021
782 views
if two variable are declared in different function with same name and static keyword then there will one variable in memory or two different variable [refrence gate 2020 ...
0 0 votes
0 0 answers
726
726 views
Arun Rout asked Nov 29, 2018
726 views
0 0 votes
0 0 answers
1.9k
1.9k views
rohit vishkarma asked Oct 25, 2018
1,850 views
Give the output of the following program#include <iostream.h>void main(){int x[]={5,2,6,9,8};int *p, q,*t;p=x;t=x+1;q=&t;cout<<endl<<*++p<<" "<< q<<" "<<*t++;}(a) 1 1 1 1...