Sorting Algorithm | Counting Sort - step by step guide
HTML-код
- Опубликовано: 4 окт 2024
- In this video we will learn about counting sort. It is an algorithm in which we don't compare two elements while sorting.
Counting Sort code link
www.dyclassroo...
Algorithm Playlist
• Algorithm
Data Structure Playlist
• Data Structures
if you find my videos interesting and enjoy watching them then please give a thumbs up, share and subscribe my channel and comment.
click the following link to subscribe my channel
www.youtube.co...
thanks for watching
see you in the next video
stay happy and keep smiling :-)
Straight to the point, no bullshit. Its amazing how a teacher who has no direct involvement not even sound can accomplish something a teacher teaching directly in class, with every facility available cannot..! Thanks
so true
Debopam Seal seal your mouth
Some of them are really jerks or useless.
Only on example 2 I understood why we should reduce the sumCount index. It needs in duplicate case.
Sometimes words come in the way of understanding. I realized this fact after watching this video. Thanks a ton!
Mindichhh blowing video
And you saved my life. Thank you so much Sir !!! Appreciate it
thanks for watching :-)
Great video! Finally, I understand it!
best in the business...very well explained....thanks man
Thank you Sir its so easy to understand .God bless you
Great explanation! Now I'm able to memorise this sorting process much more easier. :-)
Such a great guidance.
best explanation ever!!
This is the video I am looking for! Teach with patience and a bit of detail!
great video, i took a paper and a pencil as you said ant in less than 5 mins i learned how to count sort. gj sir
Are Bhai wah😂😂 Mst teacher shock ho jaega 😂😂
Fantastic Explanation...thank u so much sir
Awesome sir thnkee
i was nervous about this concept. Now you've made me confident.
Well you don't even have sound. How tf you've achieved to teach me and us..?
You, you are a real teacher.
The slowest 11minutes 40 seconds of my life......btw the explanation was clear and easy to understand with the slow pace.....good one!
to make it stable start from the last element when filling 'sorted input' array..
This is not a stable method. In example 2, the relative order of 4 changes which is not supposed to because counting sort is stable sort.
For the stable output start from the last number instead of first (in order 4,2,8,10,9,4) at 9:06
Yes to make Counting sort stable, one needs to read numbers from right to left.
Why?
Correction: (in order 4,2,8,10,4,9)
bro it is stable bcz look carefully value 4 in position 2 in input(unsorted) array appears before value 4 in position 6 input(unsorted). so in sorted array the 2nd position 4 comes before 6th position 4. thats the stability
I hate to say it but you're wrong. Look carefully what position first 4 comes to and what second. It's 3 and 2. So it's not stable
Thanks, I understood from your video what I couldn't understood from my prof.
omg... I think that was more dificult but not is very easy... thanks U!
Thank you very much for code!
Masterpiece ,
Thanks man
Fully understand.... Thank you
+Abdul Muhaimen welcome
How did you let me understand this easy?? I watched like 2 or 3 videos and read the explanation but didn't get an idea but you made it looks easy thanks a lot.
I think at least part of it is the pacing. Another video I watched was 2 minutes and rushed by it way too quickly for me to really get what was going on. With the pacing of this, I have time to process what's actually going on.
i cann't say word except talented !
Thank you very much Yusuf sir for this simple and to the point video , thank you very much and keep it up.
You are a magnificent teacher. Thank you!!!
I love the way ur teaching style its amazing and now I understand the technique that you told ...
Very very gud explain .
Really nice explanation in easy way 👍
+Ashish kumar singh thanks
Thanks - no voice was appreciated! Simple and easy to understand.
+Oliver Goldstein thanks for watching.
here is the algorithm playlist. you may find it interesting.
ruclips.net/p/PLG6ePePp5vvYVEjRanyndt7ZSqTzillom
thanks for commenting :-)
great yrrr wowww
Great video! Just what I needed to understand what's going on with this algorithm. Liked!
nice interface, simple explanation ,straight to the point ...atlast superbbb
He is doing justice to deaf computer enthusiast
You are doing great job
thank you! it is very cool to understand the counting sort algorithm.
Very helpful, thanks.
well explained.
Thank you very much , sir.
best 10 minutes of my life.
thts a grt video bro
Simple steps,nice explanation!!!
thanks for watching :-)
Amazing tutorial! really easy to understand
Excellent
This helps a lot... Thanks
you are amazing....thanks a ton.
wonderful explanation, thanks.
In Nigeria we will say this guy sabi. Meaning he knows. Guy you sabi thanks a lot
you explain so good...
Excellent explanation! Thanks.
+Alessandra Santos thanks for watching :-)
Nice video
Best teacher ever💕
Nice work ! I finally understood this for my exam, thank you !
+Andrei Dan thanks for watching :-)
+Yusuf Shakeel and all the best.
Great video, thank you :D
You, sir, are good!
thank you :-)
Thank you very much!!!!!!
+dy l thanks for commenting and watching my video :-)
amazing videos bro tysm :)
great job! keep producing, your are benefiting the world.(Y)
Fantastic Explanation ❤
Tnx man!
This is good stuff. Thank you.
thank you so much!
Thank you sir! Indians are the best in software & electrical engineering. Almost every toturial i find on youtube is indian.
You are demi-god. I was reading Algorithms unlocked and CLRS book and I was scratching my head. I wish those books had such examples. Btw, Why are we decrementing when we have non-repeating input?
awesome explaination sir.
thank you helped alot
+Abhijeet Joshi thanks for watching :-)
Just to clear this - it is unstable in this example, right? If we would have taken digits from the right (9:08) then it would be stable?
thank you so much !
ty bro ...solved.
amazing job!
thx mate
Well explained by simple examples!
Also would be nice to get some algorithm specific properties and time & space complexity
Superb explanation
Thanks Sir This video quite helpful for me May Allah bless you with ease and comfort in your life (Ameen)
Stay blessed sir
but a request there if you done this sorting according to algorithm means with each line you demonstrate the work of algorithm it much more valuable if you done it for me its an honor for me sir
gd job...
good..
counting sort is a stable sorting algorithm. in the second example the output is not stable
very very very very very very very very nice
+Ahmad Abuyousef thanks
Very nice! I think that if you would add time complexity of algorithm and pseudo code of algorithm it would be ideal ! good job
+Михаил Зиновьев thanks for watching :-)
This is stable at count & get left to right O(n) sorted values
for the given array 10,7,12,4,9,13 since minimum is 4 and maximum is 13 , we can find these values and mark them as 1 which ever element is available, what if the array contains negative values, how do you create array lets say minimum is -4 and maximum is 13 , how do we create array with indices from -4 to 13 ?
amazing brother.. keep it up!
thanks !!
awesome
Sir why are u reducing sumcount for index "number" by 1 each time whenever u put element in stored input?
Fantastic
While the two 4's in the second example does not maintain the order as in input, how could they call counting sort as stable?
U have taken example in simple way....but in complicate problem like 62,13,45,58,98,81 we have to write index from 13 to 98 is time waste process...... so the process fails
Thanks
I'm Yusuf too. I'll be posting videos soon.
thank you
Thanks this helped! so counting sort aren't stable looks like.
it is a stable one. He made a mistake by filling the output array from the input array's left to right. It should be done from right to left.
Yusuf, you did a great job. If it has voice over, the view count would have been over a 100K. Cheers man!!
+Venkat Cheedella thanks for the appreciation sir :-)
isnt counting sort suppose to be done in reverse order.
only if you want a stable sort
شكرا لك (بالعربي) :)
If the maximum no is 70 then what should be done then there is create mor index
best foken tutorial, thanks m8
yousaf bhai can u plz guide which software u use to make this sort of videos??? plz ans
Why not output the "Index" value "sumCount" number of times instead of calculating position?
thanku sir
+Ch zubair welcome :-)