in Programming in C
549 views
0 votes
0 votes

Queue could be implemented using two Stacks.

So what will be the time complexity for insertion and deletion in this queue?

in Programming in C
549 views

2 Answers

0 votes
0 votes
0 votes
0 votes
For insertion O(1) and for deletion O(n)

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