Lecture

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

  1. Outer Loop: Repeat the following steps for each item in the list.

  2. Finding Minimum: Find the smallest value from the current item to the end of the list.

  3. Item Swap: Swap the found minimum value with the current item.

  4. Repeat: Continue this process for all items to sort the entire list.

Lecture

AI Tutor

Publish

Design

Upload

Notes

Favorites

Help