What is Selection Sort?
Selection Sort is a simple algorithm that sorts a list by repeatedly finding the minimum value and placing it at the beginning.
Keywords
-
Selecting Minimum
: In each iteration, Selection Sort finds and selects the minimum value from the current position onward. -
Swap
: The selected minimum value is swapped with the value at the current position. -
Poor Time Complexity (O(n²))
: The time complexity of Selection Sort is proportional to the square of the number of elements.
Process Steps
-
Outer Loop
: Repeat the following steps for each item in the list. -
Finding Minimum
: Find the smallest value from the current item to the end of the list. -
Item Swap
: Swap the found minimum value with the current item. -
Repeat
: Continue this process for all items to sort the entire list.
Lecture
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help