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 time complexity of the selection sort algorithm?
Think about how many times we have to scan through the list.
In an unsorted array, which element do we look for first with selection sort?
Consider what we mean by sorting into order.
What is the first step in the selection sort algorithm?
Recall the initial action when you start sorting.
Selection sort is considered best suited for?
Think about where the algorithm might perform well.
Write a function that implements selection sort in a programming language of your choice. Explain the steps involved in the code clearly.
Remember to check boundaries when accessing array indices.
Given an array of integers, find out how many swaps are performed by a selection sort on it. Write code to illustrate this.
Consider implications of finding minimums and when actual swaps occur.
6 more questions in this section. Enroll free to practise them all.
Enroll free