Implement Stack using Queues (LeetCode 225) | Using single and 2 queues | Visuals and animations

  Рет қаралды 4,723

Nikhil Lohia

Nikhil Lohia

Күн бұрын

Join this channel to get access to perks: / @nikoo28
Actual problem on LeetCode: leetcode.com/problems/impleme...
Chapters:
00:00 - Intro
00:58 - Problem Statement
02:15 - Step by step demo
08:38 - Using a single queue
15:02 - Dry-run of Code
18:08 - Final Thoughts
📚 Links to topics I talk about in the video:
Queue Data Structure: • Queue Data Structure e...
Stack Data Structure: • Stack Data Structure e...
Implement Queue Using Stacks: • Implement Queue using ...
📘 A text based explanation is available at: studyalgorithms.com
Code on Github: github.com/nikoo28/java-solut...
📖 Reference Books:
Starting Learn to Code: amzn.to/3sJm8Wl
Favorite book to understand algorithms: amzn.to/4848xJH
Favorite book for data structures: amzn.to/3P96YBv
Get started for interview preparation: amzn.to/44Nn5du
🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
🎥 My Recording Gear:
Recording Light: amzn.to/3PdsViT
Microphone: amzn.to/3Exv83x
Recording Camera: amzn.to/3PwyN8e
Tablet to sketch and draw: amzn.to/3ZdKVy7
Sketching Tool: amzn.to/45XJEgY
Laptop to edit videos: amzn.to/460ofDu
💻 Get Social 💻
Follow on Facebook at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #programming #interview

Пікірлер: 21
@aravinds6406
@aravinds6406 5 ай бұрын
I wonder why your videos are not getting good views. Your way of explanation is awesome. Keep uploading more videos.
@nikoo28
@nikoo28 5 ай бұрын
I will try my best
@jagdishkhetre4515
@jagdishkhetre4515 13 күн бұрын
Excellent explanation ... Thank you so much
@jenniferfan8155
@jenniferfan8155 4 ай бұрын
Very detailed explanation. Thank you
@sahelisohanitwins7492
@sahelisohanitwins7492 4 ай бұрын
Nice explanation sir ❤
@democreation3594
@democreation3594 3 күн бұрын
Your way of explaining and presentation is great bro. you deserve more views but small suggestion after you explain the code if you code along in leetcode it will be more easier for us to understand rather than seeing the final code so it might increase the views.
@nikoo28
@nikoo28 3 күн бұрын
i do not plan on coding along in leetcode, there are a lot of youtubers who do the exact same thing. languages keep changing with time, so I would focus primarily on problem solving. You have so many chat GPTs available too which can write the code for you.
@PiyushYadav-pl9jm
@PiyushYadav-pl9jm Ай бұрын
Best explanation ever!
@limitless6189
@limitless6189 3 ай бұрын
great explaination
@akashbestcode
@akashbestcode 2 ай бұрын
amazing dude, I'm gonna subscribe you
@sahilbait2981
@sahilbait2981 23 күн бұрын
Best !!!
@prakhargarg4166
@prakhargarg4166 5 ай бұрын
Best video
@rudreshcm4172
@rudreshcm4172 4 ай бұрын
Hey nickil which software tool you use for visualizations and any drawing pad?
@nikoo28
@nikoo28 4 ай бұрын
That is GoodNotes 6
@karthik-varma-1579
@karthik-varma-1579 5 ай бұрын
Sir Please Organise the playlist or videos with video no sir if I want to learn arrays in Java then I could find the video of main understand sir
@nikoo28
@nikoo28 4 ай бұрын
have you checked the playlists on my channel?
@akhil7618
@akhil7618 3 ай бұрын
Sir, I wanted to see the code for stack using 2 queues😢
@nikoo28
@nikoo28 3 ай бұрын
Did you check the code provided in the video description?
@akhileshnandanwar7443
@akhileshnandanwar7443 3 ай бұрын
sir there is no code of stack using 2 queues
@nikoo28
@nikoo28 7 күн бұрын
class StackImplUsingQueues { Queue q1 = new LinkedList(); Queue q2 = new LinkedList(); public int pop() { if (q1.peek() == null) { System.out.println("The stack is empty, nothing to return"); int i = 0; return i; } else { int pop = q1.remove(); return pop; } } public void push(int data) { if (q1.peek() == null) { q1.add(data); } else { for (int i = q1.size(); i > 0; i--) { q2.add(q1.remove()); } q1.add(data); for (int j = q2.size(); j > 0; j--) { q1.add(q2.remove()); } } }
@engineermind1651
@engineermind1651 28 күн бұрын
your way to explain theoritical is good but explain the code you more improve please.
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 9 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 40 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 61 МЛН
Max Consecutive Ones (LeetCode 1004) | Full Solution w/ animations
14:41
Stack Implementation using a Single Queue
11:17
take U forward
Рет қаралды 178 М.
Implement Stack using Queues - Leetcode 225 - Python
7:29
NeetCode
Рет қаралды 63 М.
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 9 МЛН