// Counting sort is a stable Sorting Algorithm #include void countSort(int a[],int n,int key) { int count[50]={0}; // assigning all elements as zero int i,j; for(i=0;ikey) key=a[i]; } // calling counting sort countSort(a,n, key); return 0; }