7.12 Counting Sort (Analysis and Code) | Easiest Explanation | Data Structure Tutorials

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • Jennys Lectures DSA with Java Course Enrollment link: www.jennyslect...
    Discussed Counting Sort Algorithm with its Code.
    Step by step guide showing how to Sort an Array using Count Sort. Analysis of Counting Sort (Time Complexity)
    DSA Full Course: https: • Data Structures and Al...
    ******************************************
    See Complete Playlists:
    C Programming Course: • Programming in C
    C++ Programming: • C++ Complete Course
    Python Full Course: • Python - Basic to Advance
    Printing Pattern in C: • Printing Pattern Progr...
    DAA Course: • Design and Analysis of...
    Placement Series: • Placements Series
    Dynamic Programming: • Dynamic Programming
    Operating Systems: // • Operating Systems
    DBMS: • DBMS (Database Managem...
    ***********************************************
    Connect & Contact Me:
    Facebook: / jennys-lectures-csit-n...
    Quora: www.quora.com/...
    Instagram: / jayantikhatrilamba
    #countingsort #jennyslectures #dsa

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

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

    I think Jenny is the best on TH-cam when it comes to explaining complex sorting algorithms. Count sort and Merge sort explanation by her is outstanding.

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

    Great job! Very informative and crystal clear. I have gone through many videos trying to explain counting and radix sort aglorithms but none is as easy to understand as this one. Jenny has great teaching skills in elaborating on critical details and giving first the big picture. I wish all teachers would have the same skillset and approach. Most of the time, it is not because things are difficult that we do not dare to explain them in pedagogical manner, it is because we do not dare to peel out things in more comprehensible chunks that things are difficult.

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

      🥺

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

      Part 〽️〽️〽️〽️〽️〽️ it will work 🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂

  • @Chadagon_of_the_Swolen_Order
    @Chadagon_of_the_Swolen_Order 5 ปีที่แล้ว +55

    You did an amazing job at explaining this.
    As others said, your explanation was crystal clear.
    The fact that you fully explained each step before writing the code was also really cool because that way you can understand the code way better.
    Thanks for sharing!

  • @andrey.smolennikov
    @andrey.smolennikov 4 ปีที่แล้ว +6

    I have spent hours to understand why we do running sum before final placement and you are the only one who explained it SO CLEARLY! Thank you so much!

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

    Great job! Very informative and crystal clear. I have gone through many videos trying to explain counting and radix sort aglorithms but none is as easy to understand as this one. Jenny has great teaching skills in elaborating on critical details and giving first the big picture. I wish all teachers would have the same skillset and approach. Most of the time, it is not because things are difficult that we do not dare to explain them in pedagogical manner, it is because we do not dare to peel out things in more comprehensible chunks that things are difficult.

  • @noorbajwa1845
    @noorbajwa1845 7 หลายเดือนก่อน +1

    Mind-blowing no one teaches these complex things better than you,I'm loving to code because of you

  • @nickharalampopoulos
    @nickharalampopoulos 5 ปีที่แล้ว +30

    Thank you so much. This is the best explanation of the counting algorithm. It helped me particularly when you explained why we should start form the last element of the original array.

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

      she said so" to maintain the stability"

  • @study-me1oe
    @study-me1oe 3 หลายเดือนก่อน +1

    Wow, this is the best video I've seen for count sort. And also provided some keen drawbacks with a quick solution for sorting negative numbers too.
    One thing I would like to add is, we can improve the count sort by reducing the k value by "mapping the elements of the array" to some smaller values.
    Eg: if we have an array like 683,610,672,699,601,642. Instead of creating a count array of size 699+1, we can create a smaller array by subtracting the smallest value 601 from all elements ⇉ 82,9, 71,98,0,41. Now we can create count array of size 99 instead of 700.
    We can improve the feasible range of K this way

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

    I actually learn something from Jenny's lectures, unlike my university professors. Keep up the great work! Greetings from Vancouver, Canada

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

      looks like university profs are terrible world wide huh

  • @Hello-vt2bh
    @Hello-vt2bh 7 หลายเดือนก่อน

    Your clear explanation of the counting algorithm was incredibly helpful. The step-by-step breakdown before delving into the code enhanced my understanding significantly. It's the most comprehensive explanation of counting sort I've come across after exploring multiple sources. Keep up the excellent work!

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

    Counting sort can be confusing. Switching between the index, the element value, different arrays... Jenny manages to make it all so easy to understand. And enjoyable too. That half and hour passed quicker than an episode of Southpark. Liked and subscribed!!

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

    The way she teach is so clean , easy to understand for me even my english is limited. thanks from vietnam

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

    This is the python code for this astounding explanation.
    And you delivered the algorithm so flawlessly, thank you.
    def counting_sort(array):
    n = len(array)
    k = max(array)
    count = [0] * (k + 7)
    output = [None] * (n)
    for i in range(0,n):
    count[array[i]] += 1
    for i in range(1,k + 1):
    count[i] = count[i] + count[i - 1]
    # count[i] += count[i - 1]
    for i in range(n - 1,-1,-1):
    output[count[array[i]] - 1] = array[i]
    count[array[i]] -= 1
    for i in range(0,n):
    array[i] = output[i]

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

    Saw your video first time..... And i became a huge fan ma'am..... The way you explained every tiny things in detaaill.... Was just outstanding....

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

    The best explanation of counting sort. After going through multiple sites, could finally understand the logic here. Keep up the good work.

  • @Mandeep99
    @Mandeep99 5 วันที่ผ่านมา +1

    Love you mam you are the best one who teaches this topic in very simple manner ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

  • @mayanksingh7814
    @mayanksingh7814 15 วันที่ผ่านมา

    This is the best explanation of counting sort PERIOD.

  • @90_vrushabhjadhav43
    @90_vrushabhjadhav43 3 ปีที่แล้ว

    I watch this video 3 times then i uderstand the example with code.
    The best teacher i have ever see in may engineering life thanks henny man for very deep and very accurate explanation love you from maharashtra.

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

    This is the best explanation for Count Sort you will come across in TH-cam.

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

    I am watching your dsa series from long time but literally... You are amazing seriously your knowledge is damn good your concepts are so clear and the way you explain each and everything is remarkable. The stability concept constrain me to comment you deserve to be appreciate...
    I am preparing for my placement I am a B.Tech Final Year Student and you are helping me a lot I shared your playlist with all my college friends because the best dsa series is By Jayanti Khatri Lamba on Jenny's Lecture.
    A big thanks to you for helping me ❤️

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

    Really is best explanation of "The Counting Algorithm" !!!

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

    This was amazing! Awesome! You not only covered a LOT more than covered in similar lectures but your explanations were lucid and to the point. Thanks!

  • @hariomvitthala
    @hariomvitthala 11 วันที่ผ่านมา

    You are simply flawless.... loved your teaching methods!! Thanks a lot ma'am 🎉🙏

  • @Mdt-24
    @Mdt-24 2 หลายเดือนก่อน

    Thank you very much, i got confused with the cumulative counting array part, the other videos ive watched didnt really go into depth on how it worked to index the numbers to its correct places. Your video made me grasp this very quickly so again, a massive thank you.

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

    This is the best illustration of counting sort i have seen.

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

    This was the best of counting sort explanation. Thank you so much for this amazing video.

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

    The best explanation for counting sort!

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

    Easily one of best algorithm teachers on youtube.

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

    Best and clear explanation of Counting sort available on net.

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

    your videos are very helpful to me during my exam times ....the day before exam i only used to listen your videos ...u explained each and every concepts so nicely.. i just love your teaching ... thank you so much mam for all these videos :) :)

  • @1998charan
    @1998charan 5 ปีที่แล้ว +3

    Good Counting sort explanation available in YT.
    P.S Tried all other channels and came here.

  • @saritakumari-oh8fs
    @saritakumari-oh8fs 3 ปีที่แล้ว +1

    It was a mistry for me until I see your explanation. Thank you

  • @umarrabiuel-yakub4690
    @umarrabiuel-yakub4690 4 ปีที่แล้ว

    at first I was saying the content is too long for me but believe me is worth waiting thank you xx you are the best

  • @_-6912
    @_-6912 5 ปีที่แล้ว +3

    You have covered important concepts. You are an excellent teacher

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

    I have attended the best university in the world throught Jenny lectures. Thank u ma'am. Your teaching is the best.

  • @MahbubaPoly-c6u
    @MahbubaPoly-c6u 12 วันที่ผ่านมา

    OMG😲...your explanation😘 i have no word to say🥹🥹😘😘😘😘😘😘😘😘😘
    God bless you mam❤

  • @ABHINAVKUMAR-vh3ln
    @ABHINAVKUMAR-vh3ln 3 ปีที่แล้ว +1

    Clear and deep explanation. Worth watching 30 min video. Everyone should watch it once and you will never forget Counting Sorting, at least the nice mam here haha. Nice explanation mam by the way.

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

    absolutely in admiration of your teaching style, thank you so much!!

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

    Great explanation! This has a lot of application in terms of questions and really tricky to grasp.

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

    Excellent Mam , And Thanks from Bangladesh . I am very much helpful from this video .

  • @Άκης-θ2ε
    @Άκης-θ2ε 3 ปีที่แล้ว

    man we need teachers like her , great job

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

    Excellent teaching dear.
    Now on words , I am a big fan of you.
    Really Hatsof to you. Great Job.
    Heartly Thanks Alot.

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

    Thank u ma'am it helped a lot and your way of explaining is very descriptive which makes it easy to understand

  • @theartist8835
    @theartist8835 5 ปีที่แล้ว +11

    Thank you! You're doing a brilliant job 😬

  • @raman-jn6yt
    @raman-jn6yt 4 ปีที่แล้ว +1

    you never fail to make an impact on learning something !!! Thanks for your efforts !!! Looking forward for your other videos...

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

    Mam u r best apke samjhana ka tarika the way u explain the concept mujhe bahot accha lagta he or apke samjhana me ek clearity he jiske wajhese bahot jaldi samjh me aata he 😊👍👍👍👍
    Thank u so much mam😇

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

    In this video Computer Science Engineering In Its Peak Level By The Help Of an Awesome Professor! Your Explanation is best Madam...! #Respect_From_Calcutta

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

    2hrs of cls in just 30mins❤ that too with clear cut explanation 🙏🙏

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

    beauty with brain,,,,,,awesome combination mam with respect.......

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

    thank u so much. i literally finding and watching so many videos but i have got my ans from here with clearly and briefly

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

    Mam u are great!! i want you to be my teacher.......

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

    Thank you very much , explained very clearly , no chances of having any doubts , reminded me of real class in this time of boring online classes

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

    East & West Miss Jenny is BEST ! , North & South Everyone is out !!!

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

    Excellent explanation I ever heard in my whole life...

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

    Thank you Jenny for your clear lectures!

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

    great ma'am. u r blessing to all CS students

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

    you are best teacher for me the way you explain is just wow
    thank u very much mam

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

    Your so genius Sweety.
    You have thorough knowledge in subject/topic.
    I am really appreciating you.

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

    This is so far, the best explamation that I had seen. Amazing video. 😬😬😬

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

    Life Saver ...Big Respect from Pakistan !!!!

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

    Great explanation! Thank you! Especially thanks for explanation hot to make this sort stable.

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

    I have ever seen such a super explanation

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

    jenny i love u take this ummah ummah 😘😘😘😘 no lecture would teach this subject better than u (getting educated + with gorgeous teacher )is adipoli comination

  • @1maheshvk
    @1maheshvk หลายเดือนก่อน

    absolutely great with minute details

  • @salmankazim107
    @salmankazim107 5 ปีที่แล้ว +17

    I wish to reiterate my thanks for such a good explaination.

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

    very well explained, Thanks Maam
    Respect from Pakistan

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

    Amazing mam, i came across your channel during my interview prep, i am at microsoft usa now :)

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

      can you please give me a referral ?? I am good at DSA

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

    i love how you say "for" 😘😘 Nice explanation 👌👌👌👍👍👍

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

    I am an art student and didn't understand a dime but i like watching madame.I will watch all her videos.

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

    very good explanation the same implementation i saw in coreman book happy that you are one who refered textbook before making video

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

    wow thanks jenny for using an all-encompassing example!

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

    Thanks a million Ma'am 👍🙏God bless you 😇

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

    aap Devi ho , itna accha to hume kisi ne bhi padaya ...thanks a lot

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

    Best explanation I have seen so far for counting sort, It is just perfect mam :)

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

    Thanks for sharing! Really good explanation. I loved watching every second of this video. Keep making more tutorials like this.

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

    always heard recommendations about your channel, now I do know why. That was awesome, thank you)

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

    Awesome explanation, teaching and patience level in teaching is highhhhhhh

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

      Thank you for recognizing my contribution. I really appreciate your encouragement and kind words

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

    just brilliant. Thanks for the explanation!!!! cant be more gratefull...

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

    Thank you for the nice explanation. I have a qualifying algorithm exam and this helps me a lot!

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

    Mam you are so talented and also worked hard to makes these videos

  • @AmitYadav-hm4sz
    @AmitYadav-hm4sz 5 ปีที่แล้ว +6

    currently,i learn data structure and algorithm from GFG onlline...
    but there is not explanation of counting sort..so this lecture is good for me but your explanation is very very good...
    thanks mam

  • @sonalidoifode-gholve540
    @sonalidoifode-gholve540 4 ปีที่แล้ว +1

    Thank you so much mam for Explanation in detail

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

    Well explained mam ...beauty with the brains

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

    My slow brain magically caught up to the idea of counting sort.
    You are a wizard, Jenny.

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

    Thank you for this!!! You are the best. Very insightful and comprehensive.

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

    I highly recommend for you to take a pc and to write every algorithm you are going to explain and run to check from the result.
    anyway I really enjoyed your lectures such a kind person you are.

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

    Thanks mam great explanation by the way u r looking gorgeous loved ur video

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

    thank you maam.. You are a perfect example of "beauty with brain"

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

    Hey, you are teaching superb, this video is very useful to my university education. Thank you so much.

  • @sarachafikidrissi9020
    @sarachafikidrissi9020 11 หลายเดือนก่อน

    what an amazing explanation, you are the best at this . many thanks to you ❤👏👏👏

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

    Your detailed explanations are the best 😍 Thank you so much!

  • @CHANDANKUMAR-dc9eh
    @CHANDANKUMAR-dc9eh 5 ปีที่แล้ว +1

    thanks mam ,u just saved my ada paper, lots of love from mp......

  • @LearningStudents-i9y
    @LearningStudents-i9y 10 หลายเดือนก่อน +1

    I like full explanation lectures

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

    Clear cut Explanation. Thanks so much

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

    31 minutes is worth. Thanks for the simplest explanation.

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

    very nice & simple explanation . ...really it's very useful. .. .Good job Jenny

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

    chaala baga chepparu madam..very good explanation amma

  • @PankajKumar-mv8pd
    @PankajKumar-mv8pd 4 ปีที่แล้ว +1

    Thank you so much. You explained it very well.

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

    Thanks mam, your explaining skills are very eloquent.

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

    Nice explanation. It is an very clear and deep explanation...