Table of Contents: The Problem Introduction 0:00 - 1:10 Going Through The Levels 1:10 - 3:00 A Traumatic Flashback 3:00 - 3:29 We Realize We Already Know How to Do This 3:29 - 3:56 But...We Have A Problem 3:56 - 5:52 A Hashtable Might Be Able To Help Us 5:52 - 7:14 The Breadth First Search Walkthrough 7:14 - 13:24 Time Complexity 13:24 - 13:29 The Show Gets Hijacked By Ishan 13:29 - 13:51 A Special Property of Trees 13:51 - 14:03 An Example of The Property 14:03 - 14:41 Space Complexity 14:41 - 14:55 The Show Is Reclaimed 14:55 - 15:08 Wrap Up: Subscribe & Validate My Existence 15:08 - 15:35 Sort of Mistakes: 5:57 -> O(1) does not mean immediate access. It is an asymptotic bound on how runtime scales with large input sizes. 10:19 -> Many times I referenced the "seen" HashSet as a hashtable. I just mean it is a set of items with unique signatures. White Noise / Hissing On Audio: I know about it. I am still working to get the right sound settings right on my mic to make this disappear. The code for this problem is in the description. Fully commented for teaching purposes.
I love how you explained things in the video, it was really easy to follow start to finish! The only complaint I have is the code isn't in the description like you said it would be.
This man is saving lives out here . I am subbed and hooked .. please keep uploading .. love your work and approach to problem solving and getting that across to people in a way that feels 'for a lack of a better word. Personal .
Seeing that you have a Video on a Question that I'm Stuck on........gives me hope that I'll ever get stuck on this Type of Question Again.......Thanks Man....I Can't thank you enough......you've itched some questions and concepts into my Brain.
I love the way you explain this problem. I have solved this problem in the past but every time I struggle to traverse the parent nodes of start element. The way you add Hashmap to traverse the root is amazing. I dont think that I will forget this method now. Thanks for sharing this.
Thank you so much for explaining with such clarity and articulation so that even a newbie like myself can understand how to go about solving these types of problems!
Your explanations are the clearest I have ever seen. I've been spending hours on this problem, then I understand the solution within 15 minutes by watching this. I appreciate you uploaded all these great explanations. I love them, I mean all of them.
I kinda had doubts as to whether this will work with different nodes having the same value. And then I saw the code and realized you were storing the node references instead of the actual values. Thanks!
Firstly, thank you for your work. You are definitely the best on youtube doing these walkthroughs and a huge help to many. Second, could you also iterate through the tree and construct a new graph (list of edges), and then do a regular graph bfs to k distance? Although its an extra step it is still the same time complexity, so it is a trade off for a little more simplicity?
"Could you also iterate through the tree and construct a new graph (list of edges), and then do a regular graph bfs to k distance?" yes "Although its an extra step it is still the same time complexity, so it is a trade off for a little more simplicity?" Yes, still O(|V|+|E|) as it is BFS. And also O(|V|) space. Just the "real" space usage will be more if we clone the whole graph.
Like your explanations because you focus on the intuition and approach behind reaching the solution. Also, you repeat important keywords quite a bit which is helpful in understanding a difficult/new approach. Keep up with the good work :)
A perfect stop to every tricky problem, Thanks a ton! But is this the right choice to watch a video for a new topic? Basically, how do you suggest to watch your videos?
Thank you so much for this nice explanation. I should have subscribed your channel earlier. I'm having an Amazon interview next week but I feel that I'm not prepared yet.
Benyam had to join the SWE website cause the content is amazing...BUT REAL TALK in an interview where you spent 20-30 minutes on behavioral, it would be pretty wild to get this!!! 1 main function with 3 helpers approx 80+ lines of code (for us java peeps ) , 'i cry everytim'
Thanks very much for the awesome videos and detailed explanations. Really loved the series. Wanted to ask if you can also make a video to explain the method using DFS to solve this problem? Thanks!
This is a great video. Very clear and easy to understand explanation. Why don't you make a playlist where you organize your videos in order(e.g. 1st video to watch and so on) for people to follow?
people have suggested this but....1.) I can't make anymore playlists...I've hit the cap....and 2.) I don't think there is any order...it is just whatever topic you are weak at...and you practice that....I think that's the optimal strategy....there can be no master order of questions because that ignores that everyone is generally different and more or less adept at different categories to different degrees
Eh...I mean, that's a hard thing to answer. Like...how did doctors get good at doctoring? It'd be a long history of study and learning. So many uncountable days absorbing information. All you have to do is practice. Practice coding, read books, watch CZcams videos. A great book I have read and recommend is called "Clean Code: A Handbook of Agile Software Craftsmanship" by Robert C. Martin
Thank you dude. First, i thought i should use hashmap for storing distance of nodes from the target node but ur tricked help to map parenting of node that help me
Table of Contents:
The Problem Introduction 0:00 - 1:10
Going Through The Levels 1:10 - 3:00
A Traumatic Flashback 3:00 - 3:29
We Realize We Already Know How to Do This 3:29 - 3:56
But...We Have A Problem 3:56 - 5:52
A Hashtable Might Be Able To Help Us 5:52 - 7:14
The Breadth First Search Walkthrough 7:14 - 13:24
Time Complexity 13:24 - 13:29
The Show Gets Hijacked By Ishan 13:29 - 13:51
A Special Property of Trees 13:51 - 14:03
An Example of The Property 14:03 - 14:41
Space Complexity 14:41 - 14:55
The Show Is Reclaimed 14:55 - 15:08
Wrap Up: Subscribe & Validate My Existence 15:08 - 15:35
Sort of Mistakes:
5:57 -> O(1) does not mean immediate access. It is an asymptotic bound on how runtime scales with large input sizes.
10:19 -> Many times I referenced the "seen" HashSet as a hashtable. I just mean it is a set of items with unique signatures.
White Noise / Hissing On Audio:
I know about it. I am still working to get the right sound settings right on my mic to make this disappear.
The code for this problem is in the description. Fully commented for teaching purposes.
please make more videos
thanks a lot
ok
I cannot see the code for the problem
the code isn't in the description?
I love how you explained things in the video, it was really easy to follow start to finish! The only complaint I have is the code isn't in the description like you said it would be.
How can your content be so good man? Video after video. The best. Take a bow.
This man is saving lives out here . I am subbed and hooked .. please keep uploading .. love your work and approach to problem solving and getting that across to people in a way that feels 'for a lack of a better word. Personal .
great to hear and thx
Hey! I really do appreciate your videos. It makes everything super clear! You’re one of the best teachers so far. Keep being hyped!!
From South Korea
nice!! thanks for commenting
Seeing that you have a Video on a Question that I'm Stuck on........gives me hope that I'll ever get stuck on this Type of Question Again.......Thanks Man....I Can't thank you enough......you've itched some questions and concepts into my Brain.
I am a beginner in DS and algorithm. Have gone through 3 other channels. But I would say this is the best. Very brilliant way of conveying. Thank you
thanks
Love the way you start with your thought process, brilliant. Keep up the hard work
thanks, will do
You are brilliant, having a great gift of presenting, and also your video editing and timing is great (cutting out the right stuff). Subscribing!
thanks haha
I never see your code, you explain the algo and I try to code it myself. Thanks for the great explanation
I love the way you explain this problem. I have solved this problem in the past but every time I struggle to traverse the parent nodes of start element. The way you add Hashmap to traverse the root is amazing. I dont think that I will forget this method now. Thanks for sharing this.
nice
Thank you so much for explaining with such clarity and articulation so that even a newbie like myself can understand how to go about solving these types of problems!
Thank you so much for the video. Crisp and clear. No bullshit. Love videos like these!! Keep up the good work!!
thanks
This is the beast channel I ever seen.THKS you and your team make the toppest resources available for us.
ye
Such a Clear explanation of the thought process and the solution ! Great one as-usual
thanks
Such an ingenious approach ! Hats off to you mate. Keep posting :)
thanks
You literally put lot of effort to make us understand. Appreciate it a lot.
sure
Your explanations are the clearest I have ever seen. I've been spending hours on this problem, then I understand the solution within 15 minutes by watching this. I appreciate you uploaded all these great explanations. I love them, I mean all of them.
Aw thanks haha, dang, the first videos suck
You are the best tutor on youtube for dsa. Please make more and more videos to help us !!! Thanks a lot
ok
Yo that man Ishan hella smooth
yeah
@@BackToBackSWE for real
@@Travis-ko2jo !!!
Was stuck in this qsn for almost a day . Thanks dude!
sure
Great walkthrough! Loving these videos.
sure
really helpful this video, the clearest explanation in CZcams, thank you so much
sure
Only a word can describe you as a whole....... and that word is AMAZING
thx
Was able to solve this problem on my own after listening to your great explanation. Thanks!
sweet
I kinda had doubts as to whether this will work with different nodes having the same value. And then I saw the code and realized you were storing the node references instead of the actual values. Thanks!
Ah yeah, memory addresses have to to be unique.
using this to quick learn binary trees, super descriptive and clear, Great Work!
thx
Nice one. I like the simplicity and explanation. Thanks for that!
sure
Firstly, thank you for your work. You are definitely the best on youtube doing these walkthroughs and a huge help to many.
Second, could you also iterate through the tree and construct a new graph (list of edges), and then do a regular graph bfs to k distance? Although its an extra step it is still the same time complexity, so it is a trade off for a little more simplicity?
"Could you also iterate through the tree and construct a new graph (list of edges), and then do a regular graph bfs to k distance?"
yes
"Although its an extra step it is still the same time complexity, so it is a trade off for a little more simplicity?"
Yes, still O(|V|+|E|) as it is BFS. And also O(|V|) space. Just the "real" space usage will be more if we clone the whole graph.
But that's not the question bro
love this video! Thanks for share it. BTW the space and runtime complexity explanation was awesome! :) hehe
thanks and thanks
Really good job, amazing stuff, keep it up!
workin' on it.
Very clear explanation. The intuition and thought process helps me a lot!
Like your explanations because you focus on the intuition and approach behind reaching the solution. Also, you repeat important keywords quite a bit which is helpful in understanding a difficult/new approach. Keep up with the good work :)
ok
thank you ben you are amazing dude i was stuck with this for 4hours and u explained it in 15 minute's thanks again
sure.
All the video was super cool to watch, but the humor again... stole the show!(at the end)
Great Job!
thanks
Great explanation, best I’ve seen. Keep it up!!
Crystal clear explanation!! Thanks a ton for your efforts and time
Amazing Explanation, thanks Benyam!!!
hey thanks
You are brilliant sir.Always come to your channel whenever got stuck
thanks.
This concept was awesome !!!
Great video
thanks
Great video. Clear explanation. Thanks a ton. Love you guys. You both made it simple.
It is just me now but thank you!
@@BackToBackSWE Okay. All credit goes to you.
Love the idea, great solution, thank you!
sure
It was an amazing explaination. It made me think about other problems as well. Good job guys!
Thank you so much for the detailed explanation.❤️🙏
Sure!
A perfect stop to every tricky problem, Thanks a ton!
But is this the right choice to watch a video for a new topic?
Basically, how do you suggest to watch your videos?
We are releasing a new platform to keep everything organized today
the best explanation. Got the way in first 5 minutes itself.
This guy is so much clear in his thought process
This guy agrees :) haha
Thank you for such a great explanation !
thanks for the clear explanation. your code was even well commented & easily understandable. cheers!
cheers right back at you
where is the code though
So intuitive and amazing!
thanks
Awsome solution with great explanation technique. Thank you so much for the solution.
thx
Thank you so much for this nice explanation. I should have subscribed your channel earlier. I'm having an Amazon interview next week but I feel that I'm not prepared yet.
Nice, good luck, don't let the result determine your worth
This is awesome. Thank you!
sure
Beautiful explanation, very grateful for your videos
thanks bro, for this awesome explanation. Keep making more videos
ok
great explanation and ending, thanks Benyam!
Benyam had to join the SWE website cause the content is amazing...BUT REAL TALK in an interview where you spent 20-30 minutes on behavioral, it would be pretty wild to get this!!! 1 main function with 3 helpers approx 80+ lines of code (for us java peeps ) , 'i cry everytim'
Awesome explanation . Thank you so muchh
sure
Thanks very much for the awesome videos and detailed explanations. Really loved the series.
Wanted to ask if you can also make a video to explain the method using DFS to solve this problem? Thanks!
sure and it is basically the same
Thank you. Very well explained
That moment of happiness when you come to know that there's a BTBSWE solution for the problem that you're currently stuck with!
Excellent explanation! Please make more videos on the various algorithmetic problem
Ok, will do
great great great explanation!!
I love it, very brief explanation, much better than looking at the discussion of leetcode Lol
yeah, fuck leetcode
Thanks a lot for this!
Thanks! This video is really helpful for me to prepare the coding interview!
Thank you, glad you liked it 😀
Do check out backtobackswe.com/platform/content
and please recommend us to your family and friends 😀
great explaination !
Thank-you!! video is helpful
sure.
Thank you very much for that easy explanation.
thanks
Great explanation !! 🤩🤩🤩🤩
Very helpful. Thank you very much!!!
sure
You explanations are simple and easy to follow
Man!...You are GOD!!..Again Best explanation on the entire internet!!
im normal
I like how you squeeze your eyes to emphasise something :D
The way you explain the Concepts are very clear... But it was very helpful if u explain the problem along with some pseudo code😀
We have a code sample up but the repository is deprecated - we only maintain backtobackswe.com now.
Thank you Mr.Perfect :)
haha
thank u so much sir and entry of ben is just awesome 🤣🤣
Awsome bro ! Good explanation
thx
Superb Explanation.
You are a legend!
Man what a terrific explanation.
thanks
wow simply awesome Thanks !!!!
sure
Thank you so much!
sure
Please continue uploading videos you teach really good..RESPECT+++
ok
Okai....Concluded....You are awesome :D
thanks
GREAT explanation sir.
thx
Amazing explanation.
thx
very amazing explanation. again. thanks.
sure
Simply the best!
thanks
This is a great video. Very clear and easy to understand explanation. Why don't you make a playlist where you organize your videos in order(e.g. 1st video to watch and so on) for people to follow?
people have suggested this but....1.) I can't make anymore playlists...I've hit the cap....and 2.) I don't think there is any order...it is just whatever topic you are weak at...and you practice that....I think that's the optimal strategy....there can be no master order of questions because that ignores that everyone is generally different and more or less adept at different categories to different degrees
Awesome explanation , you saved my day
great
Very clear explaination. Hope you can make an DFS explain on this!
Thank You, Glad you liked it.
Do check out backtobackswe.com/platform/content
and please recommend us to your family and friends :)
you guys are brilliant
ye
Hey Ben, great video! Keep up the good work. I have a request, would you please recommend a way to get good at Object Oriented design?
Eh...I mean, that's a hard thing to answer. Like...how did doctors get good at doctoring? It'd be a long history of study and learning. So many uncountable days absorbing information.
All you have to do is practice. Practice coding, read books, watch CZcams videos.
A great book I have read and recommend is called "Clean Code: A Handbook of Agile Software Craftsmanship" by Robert C. Martin
Thank you dude. First, i thought i should use hashmap for storing distance of nodes from the target node but ur tricked help to map parenting of node that help me
It's really the best resource to learn
hey
nice explanation
Thank you Sir 💞
Extraordinary explaination Sir
thx
Awesome explanation
thanks