Merge sort is a divide-and-conquer sorting algorithm that works by recursively dividing an array into two halves until each half contains only one element, and then merging the sorted halves back together. The merging process involves comparing the elements of the two sorted subarrays and selecting the smaller of the two to be placed in the next position of the merged array. This process is repeated until all the elements have been merged into a single sorted array.
Shell sort is an in-place comparison-based sorting algorithm that is a variation of insertion sort. It starts by sorting pairs of elements far apart from each other, and then progressively reduces the gap between the elements being compared until the gap is 1. At this point, the algorithm is essentially performing an insertion sort on a partially sorted array, which is much more efficient than performing insertion sort on an unsorted array. The gap sequence used for shell sort can vary.
Quick sort follows the divide-and-conquer approach. It works by selecting a pivot element from the array and partitioning the remaining elements into two sub-arrays, according to whether they are less than or greater than the pivot element. This process is repeated recursively for each sub-array until the entire array is sorted.
Radix sort is a sorting algorithm that works by sorting numbers one digit at a time, from the least significant digit to the most significant digit. It relies on the property that numbers with more digits are always greater than numbers with fewer digits. The algorithm sorts the input numbers by grouping them into buckets according to their least significant digit, then sorting each bucket by the next significant digit, and so on, until all digits have been sorted.
I find https://visualgo.net/en/sorting a very helpful way to visualize how the sorting algorithms work through the data sets. First, navigate to the sorting algorithm you want to see and then you have the option to create your own data set or use the randomly generated one. Click sort to start the animation.