[Java] Leetcode 232. Implement Queue using Stacks [Stack & Queue #2]

preview_player
Показать описание
In this video, I'm going to show you how to solve Leetcode 232. Implement Queue using Stacks which is related to Stack & Queue.

Here’s a quick rundown of what you’re about to learn:

⭐️ Course Contents ⭐️
⌨️ (0:00) Question
⌨️ (2:25) Solution Explain
⌨️ (5:35) Code

In the end, you’ll have a really good understanding on how to solve Leetcode 232. Implement Queue using Stacks and questions that are similar to this Stack & Queue.

Now, if you want to get good at Stack & Queue, please checkout my Stack & Queue playlist.

Рекомендации по теме
Комментарии
Автор

Thank you! Super explanation as always.
Can you please add time/space complexity for each method?

candichiu
Автор

Really concise explanation and showing the step by step diagram really helped, along with the illustration in code comments. You're definitely one of the best voices to listen to for LeetCode walkthroughs

DanhWasHere
Автор

I just discovered your videos and I find them so helpful in my learning process! I deeply appreciate the amount of work you put in each of your videos and hope you pursue your dreams concerning this channel!

Emily
Автор

Excellent explanation it really cleared my mind on this problem!

NobleSpartan
Автор

can you please make a video that goes deeper into Amortized analysis? Like also explaining the different methods to calculate the amortized time

angelmillicent
Автор

one more method .
Push all the elements in one stack
When to pop:
1. check if stack2 is empty
transfer from stack one to stack 2 then pop
2. check after check 1 stack 2 is empty then empty queue
3. finally pop from stack 2
Why again and again push, pop . Do it only one time.

NancyPerez
Автор

Could you also add a video on the implementation of N stacks from a single array?

Wilhelmina