Implement Queue Using Stacks - MUST KNOW O(1) Solution - Leetcode 232

preview_player
Показать описание
Implement Queue Using Stacks - MUST KNOW O(1) Solution - Leetcode 232

Common computer science interview question asked by Google, Facebook, Amazon, etc..

Song: Sweet in Bitter - Homie Cat

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

Thank you for uploading this video, the best explanation of this question!

bensonchen
Автор

You have to be sure on the front pointer value, when you have moved all of the element to stack 2 and popped all of them from the same and assuming no more pushes to stack1 . As per the code you have written, the front pointer would be containing an already popped value, which should be handled.

letscih
Автор

I had something similar but was a bit off XD, good to know I was on the right track

Dehashed
Автор

Hi Derek,
Please start uploading videos once again. And also your voice is in very low volume. Kindly try to raise your voice in your next videos.
Thank you for uploading again.

qj
Автор

well! I am just not clear that how the time is O(1) when you pop stack1 and append to stack 2 all element of stack1 if stack1 has n element?

Mrchungcc