• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
July 18, 2024 |76.8K Views

Counting Sort

  Share  1 Like
Description
Discussion

Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values (kind of hashing). Then do some arithmetic to calculate the position of each object in the output sequence.

 

Counting sort makes assumptions about the data, for example, it assumes that values are going to be in the range of 0 to 10 or 10 – 99 etc, Some other assumptions counting sort makes are input data will be all real numbers.


Like other algorithms this sorting algorithm is not a comparison-based algorithm, it hashes the value in a temporary count array and uses them for sorting.


It uses a temporary array making it a non In Place algorithm.

Counting Sort : https://www.geeksforgeeks.org/counting-sort/