From 0ae6663fcd4dd92e46894d2266061ffce830e9c1 Mon Sep 17 00:00:00 2001 From: Ashutosh Maurya Date: Wed, 12 Oct 2016 01:45:33 +0530 Subject: [PATCH] Update README.md Added Counting Sort , an another sorting algorithm that sorts in linear time. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 4f6dca3..b4ac92c 100644 --- a/README.md +++ b/README.md @@ -93,3 +93,16 @@ An inplace comparison sorting algorithm that is slow for large data sets, but it |Best case performance |O(n^2) |Average case performance |O(n^2) |Space |O(1) + +###Counting Sort +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 . +( *Here max is the maximum value present in the list of elements ) + +https://en.wikipedia.org/wiki/Counting_sort|stable| +|----|--- +|Worst case performance |O(n+max) +|Best case performance |O(n+max) +|Average case performance |O(n+max) +|Space |O(max) auxillary + +