894 views
1 1 vote
how many stack are require to implement a queue ???????????????

how many queue are require to implement a stack?????????????????????

 

 

 

explain plz

2 Answers

0 0 votes
We need 2 stack to implement 1 queue and 2 queue to implement 1 stack to perform  stack and queue operation.
Position:
Show:

Related questions

9 9 votes
2 2 answers
399
399 views
GO Classes asked Jul 27
399 views
Given a stack $S$ with $5$ elements from top to bottom as:$2, 4, 6, 8, 10$and an empty queue $Q$.First, remove the elements one by one from $S$ and insert them into $Q$.T...
7 7 votes
1 1 answer
460
460 views
GO Classes asked Jul 27
460 views
Which of the following statements are true?$\text{S1.}$ Stack operations $\texttt{push}$, $\texttt{pop}$, and $\texttt{isEmpty}$ can be worst-case $O(1)$ for a linked-lis...
7 7 votes
1 1 answer
307
307 views
GO Classes asked Jul 10
307 views
Assume there are $n$ elements in the data structure. Consider the following statements:$\text{S1}:$ A stack can be implemented using a linked list such that each individu...
6 6 votes
3 3 answers
320
320 views
GO Classes asked Jul 8
320 views
Suppose an intermixed sequence of stack push and pop operations is performed. The push operations push the integers $0$ through $9$ in order. The pop operations print the...