Selection Sort Flashcards
1
Q
Which sorting algorithm repeatedly selects the smallest (or largest) element form the unsorted portion and swaps it with the first unsorted element?
A
selection sort
2
Q
What is the minimal number of swaps in selection sorting?
A
n-1
3
Q
What is the maximum number of swaps required?
A
n-1
4
Q
What is the best case time complexity for selection sorting?
A
O(n^2)
5
Q
For best case, selection sort performs _______ comparisons to find the minimum.
A
n(n-1)/2
6
Q
What is the worst-case scenario for selection sorting?
A
O(n^2)
7
Q
Why is selection sort not stable?
A
element may not be in order because of swapping
8
Q
Is selection sorting sufficient for large datasets?
A
no!