
Google Interview Question: How to Code a Queue Using a Stack. Whiteboard Wednesday by Irfan Baqui
video description
Date: 2022-03-14
Comments and reviews: 2
Dev
Hello Irfan,
So we are using recursive approach here, and under the hood recursion uses Stack. If we go through iteratively, then we have to have an array.
So ultimately I'm using one another data structure here.
So can I ask it to interviewer like what is the point to do this whole stuff when I can easily do it??
reply
Hello Irfan,
So we are using recursive approach here, and under the hood recursion uses Stack. If we go through iteratively, then we have to have an array.
So ultimately I'm using one another data structure here.
So can I ask it to interviewer like what is the point to do this whole stuff when I can easily do it??
reply
David
I really like the recursion that Irfan used while implementing the solution, I'd come up with a cycle that pops and pushes the elements until it reaches the first element.
reply
I really like the recursion that Irfan used while implementing the solution, I'd come up with a cycle that pops and pushes the elements until it reaches the first element.
reply
Add a review, comment
Other channel videos















