Stack Implementation using a Single Queue

preview_player
Показать описание

In case you are thinking to buy courses, please check below:

Watch at 1.25x for better experience ..

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

#dsa​ #striver #leetcode
Рекомендации по теме
Комментарии
Автор

"some just give road maps and make videos" and here you find the actual content you need to follow.. Great work!

Aks-
Автор

Wow, I never knew this approach by using a single queue, great explanation 👏

ayushjain
Автор

We are so fortunate to have an innovator like you. Never seen this method before ❤

anshitmishra
Автор

The issue is with q.top() at 10:06 . The queue container in C++ does not have a top() member function. Instead, you should use q1.front() to access the front element of the queue.

AbhishekSharma-ipdf
Автор

You not only teach, you make feel how to do programming ❤ no need to go for code after getting approach.

RohitKumar-dzdh
Автор

Single queue solution was really what I want 🙌

willturner
Автор

Wow, what a method of implementing stack using single queue, hats off!!!

rutikdeshmukh
Автор

That single queue method is so simple, yet so effective 💥

koushik
Автор

Bhaijaan kya samjha rahe ho❤️❤️, Matalb maine abhi c start ki hai aur mujhe bhi ye concept yaad hogya...are bhai❤️❤️

helloclass
Автор

very clever, amazed by the single queue implementation! keep up the great work striver bhai!

shreyanshmittal
Автор

The approach you taught for implementing stack using single array works only for LinkedList implementation but not with array implementation however swapping of elements works with array impl.

sriharsha
Автор

Great approach using only single queue

venkateshvenky
Автор

Should not the TC be O(N^2) as the elements are being copied from q1 to q2 for every value of /n??

ASSHIVAM-sm
Автор

I am confused if this was implemented with a single queue or two queues. Please can someone explain?

dylindian
Автор

BEST VDO!
Got 2 ways to approach the question <3

wasifirshad
Автор

finally I understood after seeing lots of explanation, thanks

codespector
Автор

Channel Subscribed! Short, to the point and understable. 🤓

gaganbedi
Автор

how come time complexity is O(n)?
When we are pushing n-1 elements for each element. It would be somewhere O(nx(n-1))
correct me if I am wrong

abdulhadi-megj
Автор

Long live
Thank you for your efforts ☺️

SaumyaSharma
Автор

Thanks bhaiya you are doing great job. Keep making videos like this

chitranshkumar