Implementing a Queue Using Two Stacks - Data Structures

preview_player
Показать описание
Thanks for subscribing!

---

This video is about how to implement a queue using two stacks.

In the video the following concepts are explained:
- The stack ADT.
- The queue ADT.
- How to implement the methods that are needed for implementing the queue (emptiness, size, enqueue, dequeue and front) in terms of pseudocode.

---

If you thought this video was useful, make sure to give it a like!
If you want to support this channel, make sure to subscribe.
If you have any questions, use the comment section.

This video has been published by MisterCode.
Рекомендации по теме
Комментарии
Автор

Great explanation, you basically have an input and an output Stack!

athego
Автор

Quick and thorough explanation, also very good English!

urrpurr
Автор

thanks G. explained in 5 minutes very well

tetsuorulin
Автор

Quick and clear! Great explanation, thanks

turtleyoda
Автор

The best video I came across, helped me a lot..

Gauravsharma-gdfm
Автор

Thank you very much ! You helped me with my homework. I gave you a thumbs up !

lazyelectron
Автор

Very nice video beautiful explanation of problem and the solution, I hope you will make more videos on DS and Algo. many people struggle with these topics.

HarshVerma-ozuo
Автор

Fast and easy to u deter and explanation, thanks!

melissam
Автор

Super sir😍😍😍thank you so much.. Love you 😍

lakhveer
Автор

wouldnt the pop() on s2 give 'z' since pop() removes the last elemnt of the array but first element of the stack?

kewtomrao
Автор

Why would one ever do this in real life? It seems to me this approach supports O(n) for dequeue....but a linked list or circular array could do dequeue in O(1) could it not?

jayquelin
Автор

That accent though.... BTW nice video thanks!

VarsneyaSrinivas
Автор

This is not correct. 5:17 if you call size() after pop(), you are supposed to get 3 {y, z, b} instead of 1 {b}.

cjchen