Recall & Review
beginner
What is the main idea behind the Selection Sort algorithm?
Selection Sort repeatedly finds the smallest element from the unsorted part and moves it to the beginning, sorting the list step by step.
Click to reveal answer
beginner
How many passes does Selection Sort make over the array?
Selection Sort makes n-1 passes over an array of n elements, because after placing n-1 elements, the last one is already sorted.
Click to reveal answer
intermediate
What is the time complexity of Selection Sort in the average and worst cases?
The time complexity is O(n²) because it uses two nested loops: one to select the position and one to find the minimum element.
Click to reveal answer
beginner
Does Selection Sort require extra space for sorting?
No, Selection Sort sorts the array in place and requires only a constant amount of extra space (O(1)).
Click to reveal answer
beginner
Show the first step of Selection Sort on the array [29, 10, 14, 37, 13].
Find the smallest element (10) and swap it with the first element (29). The array becomes [10, 29, 14, 37, 13].
Click to reveal answer
What does Selection Sort do in each pass?
✗ Incorrect
Selection Sort finds the smallest element in the unsorted part and swaps it to the front in each pass.
What is the best case time complexity of Selection Sort?
✗ Incorrect
Selection Sort always takes O(n²) time because it scans the entire unsorted part to find the minimum element.
How much extra memory does Selection Sort need?
✗ Incorrect
Selection Sort sorts the array in place and needs only constant extra space.
Which of these is true about Selection Sort?
✗ Incorrect
Selection Sort is unstable because swapping can change the order of equal elements.
After the first pass of Selection Sort on [5, 3, 8, 4], what is the array?
✗ Incorrect
The smallest element 3 is swapped with the first element 5, resulting in [3, 5, 8, 4].
Explain how Selection Sort works step by step on a small array.
Think about how you pick the smallest item and place it at the start repeatedly.
You got /4 concepts.
Compare Selection Sort with Bubble Sort in terms of time complexity and stability.
Consider how each algorithm moves elements and whether equal elements keep their order.
You got /4 concepts.