1. Algorithm Description: Insertion Sort is a simple sorting algorithm that builds a sorted array one element at a time by repeatedly taking one element from the unsorted portion and inserting it into the correct position in the sorted portion.
2. Steps of Insertion Sort:
3. Time Complexity: O(n²) in the worst and average case, and O(n) in the best case (when the array is already sorted).
4. Space Complexity: O(1), as it operates in-place.
5. Stability: Insertion Sort is a stable algorithm.
6. Suitability: Efficient for small datasets or nearly sorted arrays.