Radix Sort

Consider an array that stores account numbers of all employees. One unique thing about account numbers is that they have equal number of digits. Let […]

Recursive implementation of Insertion Sort

We discussed Insertion sort in detail earlier. This post shows the recursive implementation of Insertion Sort.

Counting Sort

It is used when there are few unique elements in an array. Counting sort takes O(n+k) time in the worst case, where n is number […]

Find popular element in an array

Given a sorted array of integers, find a “popular” element i.e. one which occurs more than n/4 times. If no such element exist (which occurs more […]

Insertion Sort

Insertion sort is the most common sorting technique used by card players to sort their cards. It sorts the array in-place and is the one […]