![Potato Coders](/img/default-banner.jpg)
- 7
- 213 555
Potato Coders
เข้าร่วมเมื่อ 9 พ.ย. 2020
Hey everyone, we decided to create this channel to help out with your computer science journey.
Here are the things we hope to cover in the future:
1) Data Structures and Algorithms
2) Programming language & frameworks
3) Behavioural Interview
Subscribe to the channel 🔔 and feel free to reach out with any questions!
Here are the things we hope to cover in the future:
1) Data Structures and Algorithms
2) Programming language & frameworks
3) Behavioural Interview
Subscribe to the channel 🔔 and feel free to reach out with any questions!
Union Find in 5 minutes — Data Structures & Algorithms
This video covers one of the most popular data structures and algorithms topic "Union Find". This is an instruction showing how to run Union-Find on a graph, with examples and code. Union Find and Disjoint Set are not as difficult as we think! 😊
#graph #data_structures #algorithms #faang #Union-find #disjoint set #data-structures #recursion #leetcode #interview #algo #disjoint-sets #disjoint sets
Facebook: PotatoCoders/
Linkedin: linkedin.com/company/potato-coders
#graph #data_structures #algorithms #faang #Union-find #disjoint set #data-structures #recursion #leetcode #interview #algo #disjoint-sets #disjoint sets
Facebook: PotatoCoders/
Linkedin: linkedin.com/company/potato-coders
มุมมอง: 193 145
วีดีโอ
Recursion Interview Question - "Kth Symbol in Grammar" (Data Structures & Algorithms)
มุมมอง 12K3 ปีที่แล้ว
0:12 - Problem description 1:02 - Problem examples 1:37 - Algorithm Explanation 4:24 - Pseudocode (explains idea behind algorithm) 5:55 - Full code solution (explains idea behind implementation) 7:04 - Time Space Complexity Here's the explanation on how to solve popular Data Structure & Algorithms question on Leetcode, "Kth Symbol in Grammar". This is a classic question that we get from technic...
Graph Interview Question - Course Schedule (Topological Sort)
มุมมอง 4.7K3 ปีที่แล้ว
Please like and subscribe! Comment any of your feedback down below. 😃 Here's the explanation on how to solve popular Data Structure & Algorithms question on Leetcode, "Course Schedule". This is a classic question that we get from technical interviews at Google, Facebook, Amazon, Microsoft, and so on. Let’s try this question to learn more about topological sorting, kahn’s algorithm, graph traver...
Facebook Coding Interview Question - Merge Two Binary Trees
มุมมอง 1.9K3 ปีที่แล้ว
Here's the explanation on how to solve popular Data Structure & Algorithms question on Leetcode, "Merge Two Binary Trees". This is a classic question that we get from technical interviews at Google, Facebook, Amazon, Microsoft, and so on. Let’s try this question to learn more about binary trees and recursion. Feel free to comment any questions!
Stack Interview Problem - Check Balanced Parentheses ("Valid Parentheses" on Leetcode)
มุมมอง 1.1K3 ปีที่แล้ว
Leetcode #20. Valid Parentheses leetcode.com/problems/valid-parentheses Stack Question
Really clear and concise explanation. This video helped a ton.
bro... come back ur vids r so good 😭
Wer sieht das auch für's HAW Studium?
Thank you! This was very helpful
Python code: # WITH Path Compression def find(self, parent, x): # finds root or representative of disjoint-set/union if parent[x] != x: parent[x] = self.find(parent, parent[x]) # path compression step return parent[x] def union(self, parent, x, y): root_x = self.find(parent, x) root_y = self.find(parent, y) parent[root_x] = root_y # WITHOUT Path Compression def find(self, parent, x): # finds root or representative of disjoint-set/union if parent[x] != x: return self.find(parent, parent[x]) return parent[x] def union(self, parent, x, y): root_x = self.find(parent, x) root_y = self.find(parent, y) parent[root_x] = root_y
Solved my hours long quandary in 5 minutes. Thank you!
Great explaination with beautiful graph!!! Love it with your DSA explaination.
Great explanation
is there any other way to do it?
very clear! Thanks!
To optimize it, the find function should set the parent of it's parent to find(x). (This will probably help a lot) function find(x): if Parent[x] != x: parent[x] = find(parent[x]) return parent[x] If I'm wrong please tell me.
Correction, this does not run in O(logn), but in O(n). To get O(logn) optimization, you need to use union by rank or by size.
This video is so gud but looks like the channel ain't active anymkre 🥺💔 I really loved the explanation n quality so thankuu n hope u r doing well ✨
But why are you doing log K I think for every level you are just doing one operation so the time complexity is just O(N)
this is my question too. It looks like the operations are constant for each level?
This was actually insanely helpful in understanding the concept. Thanks!
It so simple and straight forward. Thanks you so much
beauty
That was so easy i spent an hour on this😭😭😭
The Big-Theta runtime for find() would be Θ(n).
You got a video on path compression?
Really great explanation. Couldn't understand it earlier but now got it. Thank you.
good video
Great explanation. Was able to recall what I had learnt a while back. Thank you!
Bro this topic is confusing AF, but at least this vid makes it somewhat understandable
Thanks Mr. Tater.
Thank you very much. Nice video.
Amazing! It's very clear. Thank you
Best explanation in this question
This is O(n) time complexity the modulo is a constant operation, also since were only modding 2 here we can just check the first bit in k to see if its a 1 or 0
This video was great! definitely not something that's very clearly covered in alot of other sources
Perfectly explained. Thanks
Short and clear, thanks
wonderful explanation! Thanks mate!
Still don’t understand shit
Thanks for the concise and easy-to-understand explanation!
really kool I have same approach in mind but wasn't able to solve thanks for the video
Thank you so much this is great!
Great explain, helpful visuals. Thnaks
Thank you so much man
Thanks
awesome
fantastic video! thanks!!!
Beautiful demonstration with clear mind
best explanation every ! :D
Why do we need to take ceil for k/2 i.e. k/2+k%2? Why just k/2 does not work, can someone explain, please? Thank you.
Really love your explanation and your simplistic code! This is by far the best video content on the topic I've seen so far, many thanks!
thanks a lot for explaining in few minutes.
Amazing video, very easy to follow, thank you! 🎉
There are two issues here: 1. When performing union, you set parent of the smaller set to the representative of the larger set. 2. When finding a path, you compress the path on your way back, improving O(logn) ops to O(log* n) in average.
what do you mean by O(log* n) what is the *?
dood this is amazing please do more videos man , like dp problems