Selection Sort is a comparison-based sorting algorithm that divides the input list into two parts: the sorted and the unsorted portion. It repeatedly selects the smallest (or largest, depending on sorting order) element from the unsorted portion and swaps it with the first unsorted element, expanding the sorted portion one element at a time.
Time Complexity:
Best Case: O(n²) (regardless of the initial order of elements)
Average Case: O(n²)
Worst Case: O(n²)
Space Complexity:
O(1) (in-place sorting; requires a constant amount of additional memory)
Selection Sort is not efficient for large datasets but has the advantage of being simple to understand and implement.