Counting Sort Explained and Implemented with Examples in Java | Sorting Algorithms | Geekific

Поділитися
Вставка
  • Опубліковано 11 лис 2024

КОМЕНТАРІ • 11

  • @josephthecreator
    @josephthecreator 2 роки тому +3

    BEST video I've stumbled across so far on explaining the counting sort algorithm. Really helps to see actual code with the video. Thank you!

    • @geekific
      @geekific  2 роки тому

      Thanks a lot!! Glad it helped :)

  • @g1patil
    @g1patil 3 роки тому +1

    thanks a ton for covering more use cases than simpler one. Really good. !! Hope more people come here and this channel grows !!

    • @geekific
      @geekific  3 роки тому

      Thanks for your kind words they're much appreciated!

  • @bakermrad
    @bakermrad 11 місяців тому +1

    this was amazing

  • @dongct2504
    @dongct2504 2 роки тому +1

    you are simply the best

  • @mohammad-karbalaee
    @mohammad-karbalaee Рік тому +1

    Brilliant

  • @aryanmalewar7789
    @aryanmalewar7789 2 роки тому +1

    can u explain how this sort works for strings??

    • @geekific
      @geekific  2 роки тому +2

      Well, counting sort is typically used on integers as we are collecting the frequency of each integer in the array. But, if you would like to do a modified version that instead counts the occurrence of strings, you'd have to first map each string to an index (hashing) and then apply it as shown in the video. However, note that this would not be optimal at all if your array does not contain a lot of frequently repeated strings. Let me know if this answers your question!

    • @aryanmalewar7789
      @aryanmalewar7789 2 роки тому

      @@geekific yeah, thanks :)

  • @botondmate607
    @botondmate607 Рік тому

    Amazing video but do keep that in mind that these two algorithms are not stable.