Neco 2025 Computer Studies Question 19

Practice objective / multiple choice question 19 from the 2025 Neco Computer Studies examination.

Neco 2025 Computer Studies Objective / Multiple Choice Medium Difficulty
Question 19 NECO • 2025 • COMPUTER_STUDIES • objective

Consider the following pseudocode:\n\n``\ncount = 0\nfor i = 1 to n do\n j = i\n while j <= n do\n count = count + 1\n j = j + i\n end while\nend for\n``\n\nExpress the total number of times the statement `count = count + 1` is executed as a function of \( n \), and state the time‑complexity of the algorithm using Big‑O notation.

Answer Options

A. T(n)=\\sum_{i=1}^{n} \\left\\lceil \\frac{n}{i} \\right\\rceil, which is \\Theta(n), therefore the time‑complexity is O(n).
B. T(n)=\\sum_{i=1}^{n} i, which is \\Theta(n^{2}), therefore the time‑complexity is O(n^{2}).
Correct Answer C. T(n)=\sum_{i=1}^{n} \left\lfloor \frac{n}{i} \right\rfloor, which is \Theta(n \log n); therefore the time‑complexity is O(n log n).
D. T(n)=\\sum_{i=1}^{n} \\frac{n}{i}, which is \\Theta(n \\log n), therefore the time‑complexity is O(n \\log^{2} n).
Correct Answer
C
Correct Option:
T(n)=\sum_{i=1}^{n} \left\lfloor \frac{n}{i} \right\rfloor, which is \Theta(n \log n); therefore the time‑complexity is O(n log n).

About This Question

This is Neco 2025 Computer Studies Question 19. It is one of the objective questions from the 2025 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.

Unlock Full Access Available for Android & Windows
Chat with Support