1,282 views
0 0 votes

Consider the following statements:

S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time.
S2 : In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time.
Why both statements are correct

1 Answer

0 0 votes
I think statement 1 is correct

statement 2 is incorrect both the operation can be performed in O( 1 ) time.
Position:
Show:

Related questions

2 2 votes
2 2 answers
2.4k
2.4k views
Gurdeep Saini asked Jan 2, 2019
2,421 views
true/false ?) if stack is implemented as a array,all operation push ,pop ,is emptystack(),delete stack() can be performed in constant time.)if stack is implemented as a l...
1 1 vote
0 0 answers
2.8k
2.8k views
Na462 asked May 5, 2018
2,757 views
In implementation of queue using stack, deletion of second element from front take Ο(n) time, when insertion take Ο(1) time.Is it a true statement ?Well it can be true is...
1 1 vote
1 1 answer
1.7k
1.7k views
Ravi prakash pandey asked Apr 7, 2018
1,656 views
Hi please verify meWe can implement a stack using only one queue.Like first insert into queue and for popping a element from stack dequeue n-1 element from queue and enqu...
0 0 votes
1 answers 1 answer
2.3k
2.3k views
nick17india asked Oct 24, 2017
2,345 views
#DSI have this confusion in concluding the overflow condition of a circular Queue i.e. when the circular queue will be considered full.As per the text i have, it says a c...