Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is the first step in selection sort?
Think about how selection sort identifies which element to place first.
Explain what is meant by 'in-place sorting'.
Consider how the elements are rearranged during sorting.
What is the first action taken by the selection sort algorithm?
Think about what selection sort establishes as the first step.
Selection sort is considered an in-place algorithm.
Recall the definition of in-place algorithms.
Demonstrate how selection sort behaves on an array with all elements the same, e.g., [3, 3, 3, 3]. What will the process look like?
Think about what happens when the minimum element is always equal to the current element.
Modify the selection sort algorithm to sort in descending order. What changes are required?
Consider how the definitions of 'smallest' and 'largest' affect the approach.
6 more questions in this section. Enroll free to practise them all.
Enroll free