Gce Model Questions Vol1 2019 Computer Studies Question 35

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

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

The following variant of bubble sort is used on an array of 10 distinct numbers:\n\nSET swapped = true\nSET pass = 0\nWHILE swapped AND pass < n-1\n SET swapped = false\n FOR i FROM 1 TO n-pass-1\n IF A[i] > A[i+1] THEN\n SWAP A[i], A[i+1]\n SET swapped = true\n ENDIF\n ENDFOR\n SET pass = pass + 1\nENDWHILE\n\nWhat is the maximum possible number of comparisons performed, and what is the minimum possible number of comparisons performed, for this array size?

Answer Options

A. Maximum 55 comparisons; Minimum 9 comparisons
Correct Answer B. Maximum 45 comparisons; Minimum 9 comparisons
C. Maximum 45 comparisons; Minimum 10 comparisons
D. Maximum 40 comparisons; Minimum 9 comparisons
Correct Answer
B
Correct Option:
Maximum 45 comparisons; Minimum 9 comparisons

About This Question

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