The selection sort algorithm repeatedly moves the smallest element from the unso
ID: 3723121 • Letter: T
Question
The selection sort algorithm repeatedly moves the smallest element from the unsorted list to the beginning of the unsorted list.
a. true
b. false
It can be shown that the average number of key comparisons for insertion sort is ____.
a. O(n)
b. O(n2)
c. O(n log n)
d. O(n2 log n)
In selection sort, suppose there is a list of length 4. How many key comparisons will be made?
a. 6
b. 16
c. 32
d. 64
A heap is a list in which each element contains a key, such that the key in the element at position k in the list is at least as large as the key in the element at position 2k + 1 (if it exists), and 2k + 2 (if it exists).
a. true
b. false
A selection sort cannot be applied to linked lists.
a. true
b. false
Explanation / Answer
The selection sort algorithm repeatedly moves the smallest element from the unsorted list to the beginning of the unsorted list
Ans: True.
The selection sort algorithm is the type of sorting alogorithm which sorts an array by finding the minimum element repeatedly from unsorted part and then putting it at begin.
It can be shown that the average number of key comparisons for insertion sort is ____.
Average performance: (n2) comparisons.
In selection sort, suppose there is a list of length 4. How many key comparisons will be made?
Ans: 16
Formula is n^2
A heap is a list in which each element contains a key, such that the key in the element at position k in the list is at least as large as the key in the element at position 2k + 1 (if it exists), and 2k + 2 (if it exists).
a. true
A selection sort cannot be applied to linked lists.
Ans: false
We can apply selection sort to linked lists.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.