This repository was archived by the owner on Jun 2, 2024. It is now read-only.
Implement counting sort in Python, JavaScript, Java, and C++. Countin… #935
+222
−27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…g sort is a linear time sorting algorithm that works well when the range of values in the input array is small.
Please fill all the details and checkbox, so we can merge PR faster.
Pull Request Template
What have you Changed(must)
I added the counting sort algorithm in Python, Java, C++ and also I updated the JavaScript implementation of counting sort by making it align with the added implementation in the other programming languages. The new implementation has been commented and written in a clearly understandable way and also, a new example array has been added to the main function to demonstrate the sorting performance of the Counting Sort implementation, also a docstring has been updated to describe the inputs and outputs of the sorting function as well as the time and space complexity. All tests pass successfully, and the new implementation has been tested on a variety of input sizes and ranges of values. This Pull Request completes the changes to the counting sort implementation and is ready for review.
Write here what you have changed in codebase
there was an implementation of counting sort in the codebase with JavaScript, but to make it align with the other implementations I modified the implementation by adding comments and doc string , and by also demonstrating the working of the sorting algorithm with an example.
Issue no.(must) - #932
Self Check(Tick After Making pull Request)
acknowledgment
README - How to Contribute