Neco 2020 Computer Studies Question 16
Practice objective / multiple choice question 16 from the 2020 Neco Computer Studies examination.
A simple selection sort algorithm makes \(\frac{n(n-1)}{2}\) comparisons to sort a list of \(n\) items. If the program reports that it performed 780 comparisons, determine the number of items \(n\). Then, assuming the list was initially in reverse order (worst case), each iteration swaps at most one element. Compute the total number of operations (comparisons plus swaps) required to sort the list.
Answer Options
About This Question
This is Neco 2020 Computer Studies Question 16. It is one of the objective questions from the 2020 Neco Computer Studies examination.
Difficulty level: Medium .
Master the Exam!
You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.