Тёмный

Disjoint Set Data Structure - Union Find Tutorial 

Stable Sort
Подписаться 13 тыс.
Просмотров 15 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 64   
@yoshi9358
@yoshi9358 3 года назад
Using the negative scale to store size is a great idea! Love your videos
@stablesort
@stablesort 3 года назад
Thanks! Let me also mention that the idea behind this implementation isn't mine - I saw it back in college =)
@raydot
@raydot 6 месяцев назад
Awesome! Been reading about this for two weeks now and this is the first time I've understood the point/purpose of a disjoint set.
@ravishankarprasad2320
@ravishankarprasad2320 3 года назад
Your videos are best value for time. To the point, with all the necessary details and visuals making it easy to understand and visualize, and no rambling, and wastage of time in writing/typing.
@shantanutripathi
@shantanutripathi 3 года назад
4
@stablesort
@stablesort 3 года назад
Thanks for compliment! That's what I strive for =)
@jean-lucsedits4319
@jean-lucsedits4319 Год назад
Better explanation then the first suggestion when searching "union find", thank you
@a..b1343
@a..b1343 3 года назад
Hi, your videos helped me a lot when I was looking for a job! I know it takes a lot of effort for these, just wanted to let you know we appreciate it! I think if you made videos every week or 2 you would explode, but understand you're probably busy with your full time commitments. Thanks
@stablesort
@stablesort 3 года назад
That's great! Congrats on scoring a job! I wish I could pump out a new video every couple of weeks... But you would not believe how many hours it takes me to make one. I am sure I'll get more efficient at the whole editing/recording/animations/etc. as I go, but for now, it's a slow process =)
@uimbtw6300
@uimbtw6300 Год назад
@@stablesort you haven't made a video since though :(
@rajneeshverma4026
@rajneeshverma4026 3 года назад
one of the best explanation, precise and compact implementation 👍
@stablesort
@stablesort 3 года назад
Thanks for the compliment and please check out the full force code, linked in the description. :)
@rajneeshverma4026
@rajneeshverma4026 3 года назад
@@stablesort saw the source code, very neat. I implemented same in GoLang :)
@adai4035
@adai4035 3 года назад
Love your videos - the most intuitive ones I've ever watched. More please? :P
@stablesort
@stablesort 3 года назад
Thank you! Will do!
@shantanutripathi
@shantanutripathi 3 года назад
4
@cripz4203
@cripz4203 3 года назад
Loved the video! Can you make one on the topic flows, cuts, bridges, articulation point, dfs tree?
@stablesort
@stablesort 3 года назад
I appreciate your topic suggestions - adding them to my list!
@astamurkirillin6727
@astamurkirillin6727 3 года назад
Great explanations, Andrey! Your channel is awesome!
@stablesort
@stablesort 3 года назад
Thanks, Астамур! I do appreciate you leaving a few good words =)
@shantanutripathi
@shantanutripathi 3 года назад
4
@vibhu613
@vibhu613 3 года назад
Lottssss of love..... Keep it up... 💛❤🧡💛💚
@kevinsmirnov264
@kevinsmirnov264 3 года назад
boah, ur videos burn through the matter. Pure delight. I hope u can keep the quality up. Are u planning on doin a video on global alignment? Since u already covered the string matching it would fit (imo).
@stablesort
@stablesort 3 года назад
Thanks for the topic suggestion, Kevin. I have not heard the term "global alignment" - do you have a link that I can read up on?
@kevinsmirnov264
@kevinsmirnov264 3 года назад
​@@stablesort Maybe I'm confusing it with sequence alignment..? As I understoud global alignment deals with finding the overall difference between two strings and is the generalization of "longest common subsequence" (LCS), and algorithms like the Levensthein-distance as well as the Needleman-Wunsch-Algorithm fall into it. I sadly have no outstanding online sources except for wiki :/
@sumeetagarwal6561
@sumeetagarwal6561 3 года назад
thanks! I actually had this DS on my list to look up and learn
@stablesort
@stablesort 3 года назад
Good timing!
@ManojKumaryOyOmaDy
@ManojKumaryOyOmaDy 3 года назад
You also given links for practice, thank you.
@stablesort
@stablesort 3 года назад
Happy practicing!
@Vaaaaadim
@Vaaaaadim 3 года назад
Neat. By delaying the update of the parent index for as long as possible, you can deduplicate work. Some values will have some parts of their paths compressed for free, provided that union operations are frequent enough. As well it's a very simple representation. In a worst case scenario though, you could imagine that every time two sets are merged, every single element of the resulting set has the find operation performed on it. For this kind of input, it would be no better(asymptotically) than a naive solution. The naive solution that comes to mind for me is that you can have a hashmap which maps values to the id of the hashset they belong to, have a hashmap which maps set id's to hashsets, and the find and union implementation would be obvious. That being said, the data structure you present would have far less overhead in comparison to two hashmaps and many hashsets.
@stablesort
@stablesort 3 года назад
Hi Vadim! Right, right, you could juggle hashsets, allocate IDs for them, then when merging have another hashmap that can look up an IDs of a hashset given some other IDs, etc. etc. It's possible to take this route but it gets complicated =) By the way, the implementation shown in the video is also not the *most* efficient. But I went with it as I think it's the most readable. Anyway, I feel like this is a good data structure to keep in the "tool box" and it can certainly make your life a lot easier in an interview situation.
@V000idZer000
@V000idZer000 Год назад
@@stablesort However to allocate a list to save the path is way more costly, than simply following the pointers another time to do the compression 😉
@jeffwangvids
@jeffwangvids Год назад
great vid thanks learning this in class right now
@aNeutrino
@aNeutrino 6 месяцев назад
Thank you for your effort on the algorithm video. I wanted to share that I found the background music quite distracting, to the point where it was impossible for me to focus on the content.
@stablesort
@stablesort 6 месяцев назад
Thanks for the feedback. A few other people have also mentioned the same thing. Point noted - I'll be sure to keep the volume down for the next one.
@madhukiranattivilli2321
@madhukiranattivilli2321 2 года назад
Hi Andrev, What quality content u have‼‼‼ I'm ammmmazed‼‼‼ There are many yt channels with amazing DS ALGO content, but I guess u r having the best presentation -- graphics, animations, etc I would love to know, if u r interested to share, how u make ur videos. May be u can make a video on this aspect. I will deeply appreciate. And, please don't stop making videos on programming concepts (DS, ALGO, problem solving techniques). Please make millions of them. I became ur fan. I'm gonna watch every videos of yours. Cheers Madhukiran 《btw, did I write ur name correctly❓ -- Andrev》
@stablesort
@stablesort 2 года назад
Thank you for such warm words! To answer your question, I use my cell phone for filming and I use PowerPoint for creating the animations/presentation. I am sure there are better tools out there but hey, this does the job =) Cheers! Andre
@89aehf
@89aehf 3 года назад
Amazing video!
@stablesort
@stablesort 3 года назад
Thanks for the compliment!
@y.violetguo5305
@y.violetguo5305 3 года назад
can you make a video on the kernel mapping function? your animations are amazing!
@stablesort
@stablesort 3 года назад
I haven't seen it before, which is great - that's the kind of stuff I like to investigate and learn myself. Thanks for suggesting the topic!
@NarpatHSuthar
@NarpatHSuthar 3 года назад
Amazing video, Great explanation :)
@stablesort
@stablesort 3 года назад
Glad you liked it!
@shantanutripathi
@shantanutripathi 3 года назад
4
@ketanyadav5618
@ketanyadav5618 2 года назад
How this can be implemented when node are dynamic and edges also can change for a node
@backistall3452
@backistall3452 3 года назад
Thanks!
@SauravSahu01
@SauravSahu01 2 года назад
Your content and voice are always super cool. But addition of the music in this video is distracting. Could have avoided background sound. Thanks.
@stablesort
@stablesort 2 года назад
cool, thanks for the feedback. I'll tone it down a little for the next one.
@spyrowolf2211
@spyrowolf2211 Год назад
Thank you for the video!, Please try avoid using catchy music in the videos, it makes it hard to concentrate (if you have to use music please try use very subtle or barely noticeably)
@卡机不
@卡机不 3 года назад
BREAKING NEWS!!!!!!!!!!!! Stable sort updated new episode!
@stablesort
@stablesort 3 года назад
Haha, it's really nice of you to say that! I hope you like it and find it useful.
@worldwide6626
@worldwide6626 3 года назад
Please make more videos
@shantanutripathi
@shantanutripathi 3 года назад
4
@stablesort
@stablesort 3 года назад
I wish to have more time in a day =)
@noahibarra3379
@noahibarra3379 2 года назад
And when we needed him the most…he vanished
@imadudin1522
@imadudin1522 2 года назад
Still waiting for the next video..!!
@moritzgro2442
@moritzgro2442 2 года назад
please keep going :(
@stablesort
@stablesort 2 года назад
I'll make you a deal - watch my kids for a few hours while I write up the script and shoot them video :) Life has gotten a bit more complicated here but more vids are on their way. Just need to find some free time!
@moritzgro2442
@moritzgro2442 2 года назад
@@stablesort You and I might appreciate that deal, but the kids wouldn't :D
@stablesort
@stablesort 2 года назад
@@moritzgro2442 😁
@dernuntius679
@dernuntius679 Год назад
The music in 0:46 is distracting.
@stablesort
@stablesort Год назад
Got it. Several people have mentioned this. Will keep that in mind for the next one. Thanks for the feedback.
@gouadriasouheyl910
@gouadriasouheyl910 Год назад
bro never add music background when explaining
@stablesort
@stablesort Год назад
Noted. Will do better for the next one!
Далее
Китайка и Красивые Глаза😂😆
00:20
Union Find Path Compression
6:36
Просмотров 122 тыс.
Union Find in 5 minutes - Data Structures & Algorithms
5:46
Union Find Kruskal's Algorithm
6:15
Просмотров 207 тыс.
Китайка и Красивые Глаза😂😆
00:20