We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hi. I originally directly followed the counting sort pseudocode on Wikipedia. However, that pseudocode is very general and meant to work with multiple languages. In Java, the code is cleaner if you use HashMaps instead of arrays to code counting sort. The algorithm I coded is the same as counting sort, including the runtime.
The Full Counting Sort
You are viewing a single comment's thread. Return to all comments →
Hi. I originally directly followed the counting sort pseudocode on Wikipedia. However, that pseudocode is very general and meant to work with multiple languages. In Java, the code is cleaner if you use HashMaps instead of arrays to code counting sort. The algorithm I coded is the same as counting sort, including the runtime.
HackerRank solutions.