Sorting Algorithms Counting sort Counting sort assumes that each of the n input elements is an integer in the range 0 to k. that is n is the number of elements and k is the…