why do we need make pushing efficient since in stacks push operation already O(1)
Why do we need make pushing efficient since in stacks push operation already O(1)
hello @Shivani999
here we are implementing stack using queue.
so when we use queue to make stack we can either make our push operation efficient or our pop operation efficient but not both.
so for this problem u are asked to make push operation efficient.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.