Tag Archives: Sorting in c

Counting sort

Counting Sort :

n is  number of values in array , k is the range of values (max Рmin )

Compexity : O(n+k)

Counting sort is a sorting technique to sort an array in linear time. It uses an extra space for counting occurrence  of each object in array. This technique is efficient when range of data is not much larger than number of inputs to be sorted.

 

 

insertion sort on array

Algorithm : Insertion Sort on array
Complexity : O(n^2)

Insertion sort on array code in C .