Introduction to
Sorting Algorithms
Sorting is a fundamental operation that organizes data into a
specific order. Sorting algorithms are the step-by-step
procedures used to achieve this.
by Ayush Suryawanshi
Bubble Sort
1 Compare
Compare adjacent elements and swap if out of order.
2 Bubble Up
Larger elements "bubble up" to the end of the list.
3 Repeat
Repeat the process until the list is fully sorted.
Insertion Sort
Iterate Insert Build
Iterate through the list, Insert the current element into Build the sorted portion of the
considering one element at a its correct position. list one element at a time.
time.
Selection Sort
1 Find Minimum 2 Swap
Scan the unsorted Swap the minimum
portion to find the element with the first
minimum element. unsorted element.
3 Repeat
Repeat the process until the entire list is sorted.
Merge Sort
Divide Conquer Combine
Recursively divide the list into Sort the individual sublists using Merge the sorted sublists back
smaller sublists. another algorithm. together.