887 views
0 votes
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 votes
0 votes
I think statement 1 is correct

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

Related questions

2 votes
2 votes
2 answers
1
1 votes
1 votes
1 answer
3