ALL NODES DISTANCE K IN BINARY TREE | PYTHON | LEETCODE # 863
Vložit
- čas přidán 9. 03. 2022
- In this video we are solving an interview question that is popular with Facebook, Amazon, and Microsoft: All Nodes Distance K in Binary Tree (LeetCode # 863).
It's an interesting problem that can be solved in a clever way by transforming the given tree into a graph and then performing a BFS to reach the solution. - Věda a technologie
My new life saver after NeetCode... Thanks!! very clear explanation.
Why not before NeetCode ;)
You got this ;)@@crackfaang
@@crackfaang your content is good but let me give you some constructive feedback ( I mean no harm)
Neetcode is more concise and to the point and also explains intuition better. Whereas you drag out sometimes and keep reiterating things that are already explained. This increases duration of video and hence lesser views.
Thank you so much for the explanation. I think you have made a mistake at 3:39 minute, actually you can reach node (1) from node (8); so adjacency list of 8 should be 8: [1]. Please correct me if I'm wrong. Thanks!
Yea I may have misspoke there. It’s okay the idea is still the same
Great video, understood everything.
Outstanding quality of the video and explanation. Well done and subbed!
Thanks for the kind words and for subscribing to my channel! It really helps me out
Top content ser 👌🏻
Excellent description! Very clear to understand.
Thank you, glad you enjoyed the content
awesome!
Hey!! A new Subscriber here😊
thank you so much for the great explanation. i just have a one question: when you build the graph, is it a preorder or a BFS traversal?
I like your explanation. Thanks for sharing,,, I foresee your channel growing very soon!!
Glad you found value in the video! Make sure to subscribe so you don’t miss future videos
Alright subscribe! Thanks
Really good explanation. Do you have a git repo? Where I can find the solutions. It's really hard to see this in video every time, for a reference.
Thanks for the kind words. I don’t currently have one but that’s a good recommendation. I will make one soon (currently on the beach enjoying some time off work 😊)
@@crackfaang on the beah? Wow, that must be fun. Where do you live If you don't mind me asking.
My city is not located near the coast so it's really exciting for me to live near a beach.
@@crackfaangthank you for the great work❤ I don’t know if you have created a git repo or not, but i can suggest something I use. There’s a chrome extension LeetSync, it uploads your submitted code to github automatically, so you don’t need to do extra work
Hey can you make the Leetcode "Find all people with a secret"? I was asked by Amazon but I couldn't come up with a nice solution during the interview
I’ll add it to my queue of videos to make! Stay tuned
Okay, thank you!! I can't wait
What is the overall Time Complexity?
building the graph is O(n), search is O(n) so both reduce to O(n)
He says time complexity at 14:00