Explanation

- **Selection Sort** is a simple comparison-based sorting algorithm. It works by repeatedly selecting the smallest (or largest, depending on sorting order) element from the unsorted part of the list and swapping it with the first unsorted element. This process is repeated until the entire list is sorted.
-
  • Steps:

    • Start with the first element in the list.
    • Find the smallest element in the unsorted portion of the list.
    • Swap the smallest element with the first unsorted element.
    • Move the boundary of the sorted portion to the right.
    • Repeat the process until the entire list is sorted.
  • Time Complexity:

    • Best Case, Average Case, Worst Case: O(n^2)