Posts

Showing posts from September, 2022

Quick Sort

Image
  Lomuto Hoare

Shell Sort

Image
Shell Sort: Compare elements at K distance.  

Selection Sort

Image
Selection Sort : Take out the current element and compare with all elements to the right to find the smallest element. Swap current and smallest element. arr[] = {9, 6, 7, 5, 2};  

Insertion Sort

Image
  Insertion Sort : Take out the element and compare it with all elements before it.

Bubble Sort

Image
Bubble Sort: Compare two consecutive elements. Swap if they are out of order. Highest number will bubble to end after each pass.