Practical Programming Algorithm: Disjoint Sets

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 57

  • @oisinodwyer
    @oisinodwyer 8 лет назад +9

    You sir, are an amazing person.

  • @0anant0
    @0anant0 4 года назад

    Your knowledge and teaching skills are simply awesome!

  • @giaphatha88
    @giaphatha88 9 лет назад

    superb video! I mean the whole series too, this is way better than my teacher's instructions

  • @cooleobrad
    @cooleobrad 6 лет назад +4

    Love these videos, very straight forward and well defined.

  • @NehadHirmiz
    @NehadHirmiz 9 лет назад +1

    Your tutorials are amazing. Thank you so much for putting the time and creating them

  • @starizard42
    @starizard42 7 лет назад

    Thank you very much for this tutorial!
    Your illustrations have helped me understand the concept clearly

  • @ionut-catalinsandu1921
    @ionut-catalinsandu1921 8 лет назад

    Thank you for your effort ! This has proven to be a great help for me.

  • @dimrirahul
    @dimrirahul 9 лет назад

    Awesome tutorial, short and precise.

  • @KanagaveluSugumar
    @KanagaveluSugumar 8 лет назад

    This is an excellent tutorial on Disjoint Set. Thank You!!!

  • @giaphatha88
    @giaphatha88 9 лет назад +3

    Can you please create more videos like this? I find this combination of code walkthrough and algorithm explaination very easy to comprehend

  • @murghay01
    @murghay01 7 лет назад

    subscribed. I'm watching you forever. I feel a job at Google or Facebook coming. Thanks so much.

  • @koeber99
    @koeber99 4 года назад

    The last Union method doesn't increase the "RANK" (size) after the merge of the two sets. Also, after merging of "many" sets, the time complexity of Find will still be O(depth).

  • @danielrotta7899
    @danielrotta7899 5 лет назад

    This is a very good explanation.

  • @DaxXx988
    @DaxXx988 10 лет назад

    You can improve the performance of the structure by putting Parent[item] = Find(Parent[item]); and then returning Parent[item] - in the else case.
    This simulates the tree "flattening", and provides amortized O(1) performance. :)
    Cheers and thank you!

  • @kalebnegussie8140
    @kalebnegussie8140 4 года назад +2

    Nice video, thank you. However the union function is a bit simplistic. I know it is hard to code an exact data structure but it would be nice to mention that additional checks. Like not being able to union 'chars' that are not roots. But great video.

    • @martedesco
      @martedesco 4 года назад +1

      Correct, the union should look for the root node before performing the operation

  • @codingandmathvideos
    @codingandmathvideos 10 лет назад +1

    Hey bo, could you tell me what tools you use to create such high quality videos? I'll to create educational youtube videos of such high quality as yours.

  • @oakvich
    @oakvich 8 лет назад

    This is a great explanation. Since you're using a hash table how would you print out the members of the set?

  • @name-si5yf
    @name-si5yf 4 года назад

    Man the way he spelled the LOOT that was
    amazing

  • @artnovikovdotru
    @artnovikovdotru 9 лет назад

    Nice. But what about a time complexity of the improved (with ranks) algorithm?

  • @crypticparadigm2180
    @crypticparadigm2180 5 лет назад +1

    is Union(S1,S2) = Union(S2, S1)?

  • @Selim_Hasan_Raj
    @Selim_Hasan_Raj 4 года назад

    are Sets data structure and Disjoint Sets same?

  • @mixolyde
    @mixolyde 8 лет назад

    Is there an example of a Disjoint Set that remembers the size of each set?

  • @sijua7695
    @sijua7695 5 лет назад

    The website in your description does not work.

  • @89Valkyrie
    @89Valkyrie 9 лет назад +8

    your second union implementation is incorrect for what you're describing. You are right in saying that a smaller tree should be attached to the bigger one, but that does not really solve the problem of the height of the tree, because you can attach a tree to the END (leaf) of another tree, and its height would increase by the size of the smaller tree. But you don't change the ranks at all for that even in your method, which would lead to big erros in the future for comparing ranks of trees.
    If you wanted to solve the height issue, you should first:
    1) Find the root of set_1
    2) Find the root of set_2
    3) THEN compare the Ranks of those 2 sets and union accordingly and increase rank of root by (bigger tree rank) - (smaller tree rank)

    • @jeremyng3552
      @jeremyng3552 8 лет назад

      Correct indeed, however his picture illustration helped me to understand the concept clearer.

    • @majormoody
      @majormoody 6 лет назад +3

      You don't attach the root of the smaller tree to a leaf... you attach the root of the smaller tree to the root of the larger tree. The height of the resultant tree has not changed. set_1 and set_2 are the roots of their respective trees.

    • @guitarockdude
      @guitarockdude 6 лет назад

      I think the implication is that you would first use the find function to get the loot, and then use union on that. It would be smart to enforce that though, a simple find function in union would do it.

  • @BigBangBoxes
    @BigBangBoxes 9 лет назад

    Bo Qian, what IDE are you using? Thanks for the video.

    • @Deeharok
      @Deeharok 8 лет назад +1

      +OUR S10 Looks like visual studio

    • @Leon-pn6rb
      @Leon-pn6rb 8 лет назад

      +OUR S10 Def codeblocks

  • @ushernut
    @ushernut 11 лет назад

    very clear, very good

  • @abocidejofa9686
    @abocidejofa9686 11 лет назад

    you are awesome. Thanks for your help. Can you also solve problems with the "trie" data structure? What about backtracking problems, boyle-morris, kmp, and rabin-karp
    searching for multiple words simultaneously? I would appreciate it. I'm already subscribed to your channel.

  • @Biabapumpel
    @Biabapumpel 10 лет назад

    This really helped! Thanks alot

  • @codingandmathvideos
    @codingandmathvideos 10 лет назад

    Thanks bo. you are very good. Can you please solve problems with advanced data structures like Trie and Suffix tree?

  • @sivavarma111
    @sivavarma111 9 лет назад

    that really helped sir...tq so much

  • @Sohanbadaya
    @Sohanbadaya 11 лет назад

    Thanks a lot sir. Very useful video :)

  • @oanastanciu7740
    @oanastanciu7740 6 лет назад

    Can you post source code?

  • @martialmathers3303
    @martialmathers3303 7 лет назад

    thanks for the lutorial!

  • @gunnar560
    @gunnar560 11 лет назад

    Awesome, thanks

  • @marcuscheung5025
    @marcuscheung5025 5 лет назад

    真棒!!!

  • @HarvinderSandhuEsq
    @HarvinderSandhuEsq 6 лет назад

    Great video with a great accent (not sarcastic)

  • @bousslucifer3022
    @bousslucifer3022 7 лет назад

    chigga r u saying loot

  • @DharaniNathan
    @DharaniNathan 8 лет назад

    thank you

  • @yinqiankeke
    @yinqiankeke 10 лет назад

    Love your video, very helpful... Just hope you could speak a little faster...

  • @lokikuba4857
    @lokikuba4857 9 лет назад

    Thumb up !!!

  • @rainaw0924
    @rainaw0924 7 лет назад +6

    "loot"?

    • @zariumsheridan3488
      @zariumsheridan3488 5 лет назад

      yes, return the loot) Still, excellent explanation. liked:)

  • @AlokKumar-mb6dn
    @AlokKumar-mb6dn 5 лет назад

    There must be mega-like or super-like kind of thing along with like ..👍👍

  • @brodderick
    @brodderick 6 лет назад

    great video--but your initial union function makes the parent of the second argument the first argument. Meaning, UNION(a, b) makes a the parent of b. However, your diagrams do not show this. Thank you for the content.

  • @tuotuoriver
    @tuotuoriver 5 лет назад

    Niubility

  • @momshadalvee
    @momshadalvee 11 лет назад +3

    "loot" lol

  • @satyajeetjha1681
    @satyajeetjha1681 7 лет назад

    loot

  • @13Septem13
    @13Septem13 10 лет назад +11

    You have amazing videos but you really need to work on your 'r' and 'l'.