210 likes | 332 Views
This presentation is based on the counting sort Algorithm. This data structures and Algorithm tutorial make sure that sorting algorithms explained well to help beginners learn counting sort. The video also covers practical demo for a better learning experience.<br> <br>This presentation will cover the following concepts:<br><br>1. Introduction<br>2. What is counting sort<br>3. Counting Sort Algorithm<br>4. Implementation<br>5. Conclusion<br><br>Learn more about Data Structures: https://www.simplilearn.com/data-structures-and-algorithms-article?utm_campaign=CountingSort&utm_medium=Description&utm_source=slideshare
E N D
Agenda Introduction
Agenda Algorithm
Agenda Implementation
Agenda Conclusion
Introduction Counting sort is a sorting algorithm that sorts an array's items by counting the number of times each unique element appears in the array. The count is saved in an auxiliary array, and sorting is accomplished by mapping the count to an auxiliary array index.
Introduction Counting sort is a sorting algorithm that sorts an array's items by counting the number of times each unique element appears in the array. The count is saved in an auxiliary array, and sorting is accomplished by mapping the count to an auxiliary array index.
Introduction Counting sort is a sorting algorithm that sorts an array's items by counting the number of times each unique element appears in the array. The count is saved in an auxiliary array, and sorting is accomplished by mapping the count to an auxiliary array index.
Algorithm Array Find the largest element in the array
Algorithm Array Count 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 Create a count array to store count of elements from the array “Array”.
Algorithm Array Count 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 Change the elements of count array with the cumulative count.
Algorithm Array Count 0 1 2 3 4 5 6 7 8 6-1=5 6-1=5 • Output each object from the array “Array” followed by decreasing its count by 1. Output 0 1 2 3 4 5 6 0 1 2 3 4 5 6