Gce Model Questions Vol1 2024 Computer Studies Question 35

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

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

The following pseudo‑code is executed with a positive integer \(n\): ``` count = 0 for i = 1 to n: for j = 1 to floor(n / i): count = count + 1 ``` (a) Express the total number of executions of the inner statement as a summation and state the asymptotic time‑complexity of the algorithm in Big‑O notation. (b) Using the summation, find the exact number of executions when \(n = 100\).

Answer Options

Correct Answer A. Total executions = \(\sum_{i=1}^{n} \left\lfloor \frac{n}{i} \right\rfloor\) (O(n log n)); for n=100 the total is 482.
B. Total executions = \(\sum_{i=1}^{n} \left\lceil \frac{n}{i} \right\rceil\) (O(n log n)); for n=100 the total is 511.
C. Total executions = \(\sum_{i=1}^{n} \frac{n}{i}\) (O(n log n)); for n=100 the total is 525.
D. Total executions = \(\sum_{i=1}^{n} \left\lfloor \frac{n}{i} \right\rfloor\) (O(n)); for n=100 the total is 482.
Correct Answer
A
Correct Option:
Total executions = \(\sum_{i=1}^{n} \left\lfloor \frac{n}{i} \right\rfloor\) (O(n log n)); for n=100 the total is 482.

About This Question

This is Gce Model Questions Vol1 2024 Computer Studies Question 35. 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