Minimum Height Trees | LeetCode 310 | C++, Java, Python
ฝัง
- เผยแพร่เมื่อ 15 ต.ค. 2024
- LeetCode Solutions: • LeetCode Solutions | L...
Github Link: github.com/Kno...
*** Best Books For Data Structures & Algorithms for Interviews:*********
1. Cracking the Coding Interview: amzn.to/2WeO3eO
2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
*****************************************************************************
Minimum Height Trees | Leetcode 310
Facebook Coding Interview question,
google coding interview question,
leetcode,
Minimum Height Trees,
Minimum Height Trees C++,
Minimum Height Trees Java,
Minimum Height Trees python,
Minimum Height Trees solution,
310. Minimum Height Trees,
#CodingInterview #LeetCode #Google #Amazon #Graph #tree
Great explanation. One note is that your mouse cursor is not visible so when you pointing to something like a node in a tree it is hard to guess what node you are talking about.
Thanks for letting me know.
@@KnowledgeCenter Seems you just listened and ignored. I found the same thing in your recent largest area rectangle problem too
great explanation.... I wouldn't have done this without this video..... thank you :)
Glad it helped!
Great explanation !
Glad you liked it!
for(auto &a: adj[node]){
adj[a].erase(node);
if(adj[a].size()==1)
Q.push(a);
}
I have trouble understanding this line, sir. Please help.
for(auto &a: adj[node]) is iterating through the elements of the set at location 'node'. Is that right?
node is a node in Queue, which we popped. It was a leaf. adj[node] means neighbors(in fact neighbor) of node(leaf). Try without for loop. node should have just 1 neighbor.
10:45 ---- > this, this , this ???? Kahan ho bhai?
Good explanation 👍👍
Thanks.
Great explanation
Glad you think so!
Your cursor is not visible in 90% cases. Too tough to figure out what's going on.
great sir
Thanks.
I am a bit distracted by the background noise of the video. Seems like baby is crying, or hounds. Pretty spooky.
confusing pointer
, ruined the explanation
Where is Prim's??