We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Don't we also have to keep track of the index of the old stack till which we have copied values to the new one. So in the next turn of copying data only the remaining values are added and it also checks for queue being empty.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Queues: A Tale of Two Stacks
You are viewing a single comment's thread. Return to all comments →
Don't we also have to keep track of the index of the old stack till which we have copied values to the new one. So in the next turn of copying data only the remaining values are added and it also checks for queue being empty.