fix(curriculum): clarify selection sort lab swap requirement (#65885)

This commit is contained in:
Jeevankumar S 2026-02-17 17:46:56 +05:30 committed by GitHub
parent a372fb6a1a
commit 95075822fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,8 @@ Selection sort results in a quadratic time complexity in the best, average, and
1. Your `selection_sort` function should have one parameter that represents the list of items.
1. Your `selection_sort` function should take a list and sort the items in place from smallest to largest.
1. Your `selection_sort` function should modify the input list in-place, and return it once it's sorted.
1. Your `selection_sort` function should follow the selection sort algorithm, swapping the smallest element from the unsorted portion of the list, with the first unsorted element.
1. Your `selection_sort` function should follow the selection sort algorithm, swapping the smallest element from the unsorted portion of the list with the first unsorted element.
1. Your `selection_sort` function should not perform unnecessary swaps when the smallest element is already in the correct position.
1. Your `selection_sort` function should not use either the built-in `sort()` method or `sorted()` function.
# --hints--
@ -123,7 +124,7 @@ Your `selection_sort` should modify the input list in-place. You should not use
)
```
Your `selection_sort` should follow the selection sort algorithm, swapping the minimum value in unsorted part of the list with first the unsorted element.
Your `selection_sort` function should follow the selection sort algorithm, swapping the minimum value in the unsorted part of the list with the first unsorted element. Avoid unnecessary swaps when the minimum value is already in the correct position.
```js
(