Skip to content

Create Count Sort#4

Open
asmaurya95 wants to merge 1 commit intocdmh:developfrom
asmaurya95:develop
Open

Create Count Sort#4
asmaurya95 wants to merge 1 commit intocdmh:developfrom
asmaurya95:develop

Conversation

@asmaurya95
Copy link

This is a Counting Sort Algorithm which can sort lists in linear time under certain constarints.
In this sort, we count the frequencies of distinct elements of array and store them in an auxiliary array, by mapping its value as index of auxiliary array and then place each element in its proper position in the output array .
Explaination :
Let the maximum element which can be in the array is max1 .
Now take an array having size of max1 +1 .Let it be Aux[0 ...max1] .
A[ ] = array whose elements are to be sorted (n elements ).
Out[ ] = array having sorted version of A[ ] .

This is a Counting Sort Algorithm  which can sort lists in linear time under certain constarints
Copy link
Owner

@cdmh cdmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request. However, the code is not ready to be merged. The algorithm isn't in a reusable header file and no test/demo code is integrated into the existing cpp file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments