Algorithm
Insertion Sort Algorithm:
- Start with an unsorted array.
- Consider the first element as "sorted".
- For each remaining element in the array:
- Extract the current element and compare it with elements in the "sorted" portion of the array.
- Shift all larger elements one position to the right.
- Insert the current element into its correct position in the "sorted" portion.
- Repeat the process until all elements are sorted.
Example:

Fig. 1: Iteration by Iteration Visualization of Insertion Sort
Note: Insertion Sort ensures elements are sorted by repeatedly inserting each new element into its correct position.