Thanks and other implementations include rank. Does it matter?
@jashmerchant51219 ай бұрын
Solved my hours long quandary in 5 minutes. Thank you!
@chithyFly9 ай бұрын
Great explaination with beautiful graph!!! Love it with your DSA explaination.
@civilspot59129 ай бұрын
Great explanation
@sauravnegi88589 ай бұрын
is there any other way to do it?
@nguyennguyendinh52159 ай бұрын
very clear! Thanks!
@BobTheScience10 ай бұрын
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.
@nomealow3 ай бұрын
Yes, this is called path compression, by setting the parent of x and all of the ancestors of x to be the root ancestor of x. This makes it so that find(), for that particular tree in the future, will be O(1) instead of being dependent on the tree depth
@tenminuteamateurhour10 ай бұрын
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.
@chku11 ай бұрын
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 ✨
@SahilJSawant11 ай бұрын
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)
@ben94_9 ай бұрын
this is my question too. It looks like the operations are constant for each level?
@richtigmann111 ай бұрын
This was actually insanely helpful in understanding the concept. Thanks!
@nghiapham1632 Жыл бұрын
It so simple and straight forward. Thanks you so much
@samuraipiyush Жыл бұрын
beauty
@amrutaparab4939 Жыл бұрын
That was so easy i spent an hour on this😭😭😭
@rasheedlewis1 Жыл бұрын
The Big-Theta runtime for find() would be Θ(n).
@aadityakiran_s Жыл бұрын
You got a video on path compression?
@harshit-jain. Жыл бұрын
Really great explanation. Couldn't understand it earlier but now got it. Thank you.
@pamp3657 Жыл бұрын
good video
@DeepakSankar88 Жыл бұрын
Great explanation. Was able to recall what I had learnt a while back. Thank you!
@chrisdahms9682 Жыл бұрын
Bro this topic is confusing AF, but at least this vid makes it somewhat understandable
@Rockyzach88 Жыл бұрын
Thanks Mr. Tater.
@persas1683 Жыл бұрын
Thank you very much. Nice video.
@chrismiaomiao9426 Жыл бұрын
Amazing! It's very clear. Thank you
@lostgoat Жыл бұрын
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
@WebSurfingIsMyPastime Жыл бұрын
This video was great! definitely not something that's very clearly covered in alot of other sources
@manojmpatil1269 Жыл бұрын
Perfectly explained. Thanks
@ahmetemin7572 Жыл бұрын
Short and clear, thanks
@arjunv7055 Жыл бұрын
wonderful explanation! Thanks mate!
@vivstyles1765 Жыл бұрын
Still don’t understand shit
@MinhPham-eh6lr Жыл бұрын
Thanks for the concise and easy-to-understand explanation!
@dollyakshaya75352 жыл бұрын
really kool I have same approach in mind but wasn't able to solve thanks for the video
@JamesBrodski2 жыл бұрын
Thank you so much this is great!
@surajbaranwal56.2 жыл бұрын
Great explain, helpful visuals. Thnaks
@samwilson45972 жыл бұрын
Thank you so much man
@KoScosss2 жыл бұрын
Thanks
@corgirun78922 жыл бұрын
awesome
@jakobmusic91872 жыл бұрын
fantastic video! thanks!!!
@ppsor3292 жыл бұрын
Beautiful demonstration with clear mind
@piotr7802 жыл бұрын
best explanation every ! :D
@12345ms2 жыл бұрын
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.
@markomekjavic2 жыл бұрын
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!