Sorts 11 Radix Sort

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ม.ค. 2025

ความคิดเห็น • 62

  • @zunkman1
    @zunkman1 5 ปีที่แล้ว +182

    Sort obviously occurs in a black hole at certain points.

  • @muhammadbinomar4641
    @muhammadbinomar4641 6 ปีที่แล้ว +58

    Video goes black in the middle.
    Basically what happens is he sorts the new lists based on the tenths, then hundredths and so on :)

  • @jeffhow4550
    @jeffhow4550 6 ปีที่แล้ว +54

    Why does the video blank out in the middle?

    • @mandolinic
      @mandolinic 4 ปีที่แล้ว +17

      That's the part where the topless dancing girls appear. You need to sign up to Patreon to see them.

  • @kevnar
    @kevnar 3 ปีที่แล้ว +3

    "Well, I completely fucked up the video. Entire chunks are missing. Let's upload it anyway."

  • @tarekfathi2003
    @tarekfathi2003 3 ปีที่แล้ว +15

    compared to many videos discussing the radix sort, this is the best ,most perfect one. Thank you so much

  • @ZsomborZsombibi
    @ZsomborZsombibi 5 ปีที่แล้ว +38

    Awaiting the scary scream after the full silence :)

  • @tomaslipavsky7160
    @tomaslipavsky7160 11 หลายเดือนก่อน +1

    Čau dědo, miluju tvojí torbu

  • @uvgur931
    @uvgur931 5 ปีที่แล้ว +10

    there are some tech issues in this video and some others, blank sections , please fix it.
    you are GREAT at teaching and i really hope to see more stuff that u can teach and make more sense

  • @LuisLascanoValarezo
    @LuisLascanoValarezo 3 ปีที่แล้ว +2

    I see some SORT of Black outs, could you please sort those black outs for another occasion? Thanks so much

  • @YuliiaJV
    @YuliiaJV 9 หลายเดือนก่อน

    Thank you! I am ADHDer trying to understand all this for my masters in data science and your videos most helpful. Subscribed

  • @zanzuu1249
    @zanzuu1249 7 ปีที่แล้ว +7

    thanks for the help, video has a part where it goes dark..around 2:17

    • @tarlanahad
      @tarlanahad 7 ปีที่แล้ว +1

      I also felt this :/

  • @mrunmoyable
    @mrunmoyable 5 ปีที่แล้ว +8

    Loved the explanation. Surprised by how easily you write in reverse (super legible too!) !

    • @robertzeurunkl8401
      @robertzeurunkl8401 5 ปีที่แล้ว +12

      It's an electronic blue-board. He writes on it regular, and the board then superimposes a video of him over a background in reverse. Pretty neat. You can tell it's reversed by looking at the buttons on his shirt. I, on the other hand, back when I worked for NORAD in the Cold War days, I actually had to learn to write backwards on a plexiglass window with a grease pen, so the officers on the other side could see what I was writing in normal digits. heh

    • @sofiruldanatriya3079
      @sofiruldanatriya3079 3 ปีที่แล้ว +3

      @@robertzeurunkl8401 why didn't they just give every officer a mirror? So you can just write normally.

    • @robertzeurunkl8401
      @robertzeurunkl8401 3 ปีที่แล้ว

      @@sofiruldanatriya3079 😊😂🤣

    • @twerkyfingers
      @twerkyfingers 3 ปีที่แล้ว +2

      ​@@robertzeurunkl8401 it's not electronic, he is writing on glass, then the video is reversed

    • @robertzeurunkl8401
      @robertzeurunkl8401 3 ปีที่แล้ว

      @@twerkyfingers Did you notice how he's behind the glass? ;-) I should have noticed that.

  • @setsunaes
    @setsunaes 6 ปีที่แล้ว +9

    Radix sort is just beautiful. I didn't know that in practice it is not a very good method. Always in the sounds of sorting videos Radix is the showman and I always believed that it was actually a good sorting method.

    • @poryg5350
      @poryg5350 6 ปีที่แล้ว +5

      Actually, it is very fast if you optimize it well. The reason for that is, an insertion inside an array is considerably faster than a comparison. In fact if we want to optimize it for speed, then what was done on the video:
      1. take an array of numbers and sort them to boxes 0-9
      2. take the boxes and move their sorted contents back to the beginning array
      3. repeat the step for every digit
      is speed inefficient, because step 2 doesn't contribute in sorting at all.
      What he'd need to do in order to achieve the highest speed is this:
      1. take an array of numbers and sort them to boxes 0-9
      2. take the boxes and sort their contents inside another set of boxes 0-9.
      3. repeat step 2 for each digit
      However, it is not robust.
      1. This procedure is highly speed efficient, but it's not memory efficient.
      For instance, in order to achieve the highest possible speed, you need 2x boxes 0-9 and each of the boxes has to be the size of n, where n is the amount of elements you're sorting. So in this video the person was sorting five elements, which means he'd need 20 arrays of length 5. If you are sorting 100k elements, you'll need 20 arrays of length 100k. Which is tremendously memory inefficient.
      2. It is not a comparison based sort, hence it is not a good algorithm for almost sorted arrays.

    • @poryg5350
      @poryg5350 6 ปีที่แล้ว

      So you can use it freely in cases where memory is not an issue. It will serve you well. But if you need memory efficiency, shell sort is much better.

    • @mandolinic
      @mandolinic 4 ปีที่แล้ว +1

      @@poryg5350 You can speed it up further by NOT copying the key values into bins, but instead counting how many values belong to each digit (like a counting sort) then using these counts to calculate the start position for each key digit in an output array. Once you know where in the output array each sub list is going to start, you make a second pass through the input and distribute values directly into the output array. Sure, that requires a second pass through the input, but you can speed that up by not using base 10 digits but instead using base 16 digits which can be rapidly found using shift and mask operations. Now you simply need enough memory for a second size N array, plus the trivial amount needed for the counters. Once you've finished sorting the list on the first hex digit, you just swap the pointers around so that the output array becomes the new input, and and the other array becomes the new output.

  • @gregorybrothers9650
    @gregorybrothers9650 2 ปีที่แล้ว

    Video keeps cutting out with no picture of sound.

  • @alohakuu9411
    @alohakuu9411 3 ปีที่แล้ว +2

    the video goes black but seeing how the bins work was really helpful

  • @lukmanalghdamsi3189
    @lukmanalghdamsi3189 2 ปีที่แล้ว +2

    i had mini heart attack for second right there :)

  • @MachinaMindMaven
    @MachinaMindMaven 3 ปีที่แล้ว

    You done a great job, sir, your lecture is so understandable and your teaching style is amazing sir

  • @Luca_040
    @Luca_040 6 หลายเดือนก่อน +1

    Wer ist noch wegen AD hier? 😂

  • @tombrady7390
    @tombrady7390 3 ปีที่แล้ว

    he was erasing so the glass so they blacked out that screen time and did you miss some part no i dont understand the issue here dope explanation by the way

    • @eieioo93292
      @eieioo93292 3 ปีที่แล้ว

      it actually does skip a bit, but you can fill in the context. it's also 2021, video editing exists and could have been used before posting this

  • @desiscenicdrives
    @desiscenicdrives 3 ปีที่แล้ว +1

    wow he writes it mirrored?

    • @twerkyfingers
      @twerkyfingers 3 ปีที่แล้ว

      it's not mirrored, he is writing on glass, then the video is reversed/mirrored

  • @cutieboo233
    @cutieboo233 4 ปีที่แล้ว +2

    Super helpful. Thank you Sir!

  • @yagzyalcntas553
    @yagzyalcntas553 6 ปีที่แล้ว +3

    dude all the vidoes i have watched.. that black screen stuff only happens here, come on it cant be that difficult to handle it if everybody else can...

    • @kidmash541
      @kidmash541 5 ปีที่แล้ว +1

      its pretty simple to figure out whats happening during the blanks lmfao

    • @robertzeurunkl8401
      @robertzeurunkl8401 5 ปีที่แล้ว

      @@kidmash541 I dunno, man. I failed "black board" in college. ;-)

  • @somethingfunny9341
    @somethingfunny9341 4 ปีที่แล้ว

    Wait, he has to write mirrored so we see it unmirrored

    • @twerkyfingers
      @twerkyfingers 3 ปีที่แล้ว +1

      it's not mirrored, he is writing on glass, then the video is reversed/mirrored

    • @somethingfunny9341
      @somethingfunny9341 3 ปีที่แล้ว

      @@twerkyfingers Ok, I had to watch another video of his to verify, but his earring that is usually on his right is shown on his left here. Also, most men's button-up shirts follow the "buttons on the right" convention, and here, his shirt buttons on are the left.

  • @edwincampuzano1260
    @edwincampuzano1260 4 ปีที่แล้ว +3

    He really dosent want to give us the answers.

  • @stefano8936
    @stefano8936 ปีที่แล้ว

    I got it! The real trick happens during blackouts

  • @michelfeinstein
    @michelfeinstein 2 ปีที่แล้ว +1

    Wait, is he writing mirrored? What a hero

    • @biem7091
      @biem7091 2 ปีที่แล้ว +1

      bruh

  • @deedewald1707
    @deedewald1707 4 ปีที่แล้ว

    Great video for time and detail

  • @schrodingerscat3912
    @schrodingerscat3912 6 ปีที่แล้ว +5

    ... you couldn't just do a jumpcut??

  • @pogisigena-s2n
    @pogisigena-s2n ปีที่แล้ว

    this is good

  • @FredoCorleone
    @FredoCorleone 6 ปีที่แล้ว +1

    Video goes black more than once.
    _function radixSort(array) {_

    _// maxNumberOfDigits is 4 for [5, 1048, 23, 9]_
    _// because 1048 as 4 digits_
    _let maxNumberOfDigits = ( Math.max(...array).toString() ).length_
    _for (let i = 0; i < maxNumberOfDigits; i++) {_
    _let buckets = createBuckets()_

    _// loop over items and place into buckets_
    _// accordingly to the power of ten under examine_
    _for (let j = 0; j < array.length; j++) {_
    _let number = array[j].toString()_
    _// reverse number to read power of ten as left to right_
    _// if at current power of ten there's no digit (e.g. 5 as no tens) put it into bucket 0_
    _let digit = [...number].reverse()[i] || 0_
    _buckets[digit].push(number)_
    _}_
    _// flatten buckets into array_
    _array = concatBuckets(buckets)_
    _}_
    _return array_
    _}_

  • @aakarshrai5833
    @aakarshrai5833 3 หลายเดือนก่อน

    tank u, lub the cuntent

  • @robertzeurunkl8401
    @robertzeurunkl8401 5 ปีที่แล้ว +1

    I don't like this sort because it is redundant. You keep moving a number you've already bucketed once. There should be a sort where you do basically this, but you zero left-pad all numbers to the length of the longest number, then do the sort the other way, from most to least significant. Then lose the leading zeros at the end.

    • @mandolinic
      @mandolinic 4 ปีที่แล้ว +1

      Don't forget that in a computer, all unsigned integer values are already zero padded to the left, because in practice they're stored as 32/64/128 bit values. No practical radix sort algorithm should ever use base 10 digits - base 16 is much faster since you can extract each digit using the very fast shift and mask operations to isolate four bits from the key.
      Have a look for videos which combine a radix sort with a counting sort. That means there's no longer any need to have specific "buckets" for each digit. You can move values directly from the input array to the correct place in an output array at the price of having two passes (a counting pass and a moving pass).
      Yes, it is possible to start from the most significant digit, but that actually creates 10 (or 16 if you're working in hex) sub-lists, each of which has to be separately sorted, presumably using form of recursion. It can be done, but I think it's going to be messy.

    • @robertzeurunkl8401
      @robertzeurunkl8401 4 ปีที่แล้ว

      @@mandolinic Exactly! Well said.

  • @jasonbill5588
    @jasonbill5588 4 ปีที่แล้ว +4

    It's San Diego State, what do you expect? The lack of care put into this video reflects the quality of education you get there.

  • @ameendababat9886
    @ameendababat9886 2 ปีที่แล้ว

    🥰

  • @zacharyhanson1767
    @zacharyhanson1767 ปีที่แล้ว

    W prof