Pergunta de entrevista da empresa MathWorks

Explain how do you implement queue using stack?

Resposta da entrevista

Sigiloso

19 de jan. de 2015

In InsertQueue(element X) operation (Using 2 queues Stack1 and Stack2) 1.Push all elements from stack1 to stack2 2.Place X onto stack 1. 3.Remove all the elements and place them back onto stack 1 DeleteQueue() 1.return element at top of stack1.