Selection Sort A Simple Sorting Algorithm
Selection Sort A Simple Sorting Algorithm
Simple Sorting
Algorithm
1 Find Minimum
Scan the unsorted part of the array to find the
minimum element.
3 Repeat
Repeat the process until the entire array is sorted.
Step-by-Step Explanation of
Selection Sort
Step 1
Find the minimum element in the unsorted part of the array.
Step 2
Swap the minimum element with the first element of the unsorted par
Step 3
Repeat the process until the entire array is sorted.
Implementing Selection Sort in C
Pseudocode C Code
3 Space Complexity
Selection sort has a space complexity of O(1), as it only
requires a constant amount of additional space to store
temporary variables.