Counting sort is an integer sorting algorithm that works by counting the number of objects that have each distinct key value and using arithmetic to determine the position of each object in the sorted output. It runs in O(n+k) time where n is the number of elements and k is the largest element. It requires an extra array to store counts of each key value. Radix sort is an extension of counting sort that sorts elements based on individual digits by performing counting sort repeatedly on each digit, from least to most significant.