1. Learn
  2. /
  3. Courses
  4. /
  5. Data Structures and Algorithms in Python

Connected

Exercise

Coding selection sort

In the last video, you studied the selection sort algorithm.

In this exercise, you will need to implement it by completing the selection_sort() function.

Instructions

100 XP
  • Set lowest to the element of the list located at index i.
  • Iterate again over the list starting on the next position of the i variable.
  • Compare whether the element of the list located at index j is smaller than lowest.