Gce Model Questions Vol1 2024 Computer Studies Question 15

Practice objective / multiple choice question 15 from the 2024 Gce Model Questions Vol1 Computer Studies examination.

Gce Model Questions Vol1 2024 Computer Studies Objective / Multiple Choice Medium Difficulty
Question 15 GCE_MODEL_QUESTIONS_VOL1 • 2024 • COMPUTER_STUDIES • objective

The following pseudocode implements insertion sort on an array A[1…n]: FOR i = 2 TO n key = A[i] j = i - 1 WHILE j > 0 AND A[j] > key A[j+1] = A[j] j = j - 1 ENDWHILE A[j+1] = key ENDFOR Assuming the input array is initially sorted in strictly descending order, how many comparisons between array elements and the variable `key` are performed when the algorithm runs on an array of size \(n = 10\)?

Answer Options

A. 55
B. 60
Correct Answer C. 54
D. 45
Correct Answer
C
Correct Option:
54

About This Question

This is Gce Model Questions Vol1 2024 Computer Studies Question 15. It is one of the objective questions from the 2024 Gce Model Questions Vol1 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.

Unlock Full Access Available for Android & Windows
Chat with Support