Definition: Linear search is a search algorithm, that checks for the key in a set of values one by one till it reaches the end of all the elements. For example: consider the array , and we need to search for the number 48. Below are …
Shell sort is also called as Diminishing increment sort, Comb sort, Gap sort invented by Donald L. Shell. In this algorithm is based on comparison, but instead of comparing and swapping adjacent elements, it compares the elements that are having certain gap present between them. Hence …
Radix sort algorithm is an interesting sorting algorithm. Because this sort is not based on comparison, rather than it is based on buckets. Radix Sort is a linear sort algorithm. The number of passes depends upon the number of digits in the maximum number in the …
Introduction: This is a very simple algorithm that works if there are only 3 different types of keys in an array. For example: If we have an un-sorted array of 0, 1, 2 as shown {2, 0, 0, 1, 1, 2, 0, 2, 1}, easy solution …
Merge Sort Introduction Merge sort is based on divide and conquer technique. Below are the basic steps, we shall look into the implementation after this. Divide: Divide the array into half. If the array has n elements, in the first level divide it by n/2. Then …