Рет қаралды 12,815
Counting Sort is an algorithm which does not use comparison to perform sorting. It works in a O(n) time complexity but there is a certain caveat. It compromises on space to give you a better time complexity. Counting sort is usually applied with some special use cases when you know the range of elements beforehand. In this video watch a live demonstration how it works behind the scenes followed by a dry-run of the code. This way the concept will stay in your mind forever.
00:00 - Intro
01:14 - Where do you use Counting Sort?
03:43 - Live Demo of Counting Sort
11:04 - Dry-run of code
15:09 - Final Thoughts
📚 Links I talk about in the video:
Bubble Sort: • Bubble Sort Algorithm ...
Insertion Sort: • Insertion Sort visuali...
Selection Sort: • Selection Sort | Live ...
Merge Sort: • Merge Sort with Visual...
Quick Sort: • Quick Sort super easy ...
Time Complexity: • What is the Time Compl...
📘 A text based explanation is available at: studyalgorithms.com/array/cou...
Code on Github: github.com/nikoo28/java-solut...
TestCases on Github: github.com/nikoo28/java-solut...
🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
💻 Get Social 💻
Follow on Facebook at: / studyalgos
Follow on Twitter at: / studyalgorithms
Follow on Tumblr at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#algorithm #sorting #tutorial