We Make Complex Algorithms Easier To Learn By Animations.
Recent Posts
Shell Sort
Setup:
Let Gap Size (GS) be initial number of elements
Repeat while GS >= 1:
Update GS: GS = floor(GS / 2)
Select indices by skipping GS elements
Insert Sort elements at selected indices
Quick Sort
In Quick Sort, we will select a pivot using the Median of three approach. And swap numbers which are less than pivot (LTP) and greater than or equal to pivot (GTP)
Radix Sort
From a high level, Radix Sort works by sorting integers from the least significant digit to the most significant digit.
Merge Sort
Given array has more than one item:
half array
merge-sort first half
merge-sort second half
merge first half and second half
Bubble Sort
Bubble up the largest number in the unsorted space
adjacent numbers are swapped when left number is greater than right number
Reduce the unsorted space
Repeat 1.and 2. until the unsorted space is empty
Insertion Sort
Left swap repeatedly first number in unsorted space until
the first number is greater than number on its left
the first number has no left number
Reduce the unsorted space
Repeat (1) and (2) until the unsorted space is empty
Selection Sort
In Selection Sort, we will repeatedly swap the first and min elements in unsorted space. And Each time a swap occurs, the unsorted space is decreased.