Stack - Implement Stack using Queue

preview_player
Показать описание
Solution:
- We'll take two queues
- For enqueue, we add element in queue-1
- For dequeue, we remove all elements from queue1 until size is 1 & add to queue2
- Now we've only 1 element left in queue1, so we remove now & this will be popped element

Do Watch video for more info

CHECK OUT CODING SIMPLIFIED

★☆★ VIEW THE BLOG POST: ★☆★

I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 400+ videos.

★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★

★☆★ Send us mail at: ★☆★
Рекомендации по теме
Комментарии
Автор

After looking into multiple videos, finally found this gem.

sharath
Автор

Sorry bro but Please pronounce the word "stack" correctly. It does not look good if you are teaching about a topic and you can't name it correctly.

newanurag