City Guilds Model Questions Vol1 2025 Information Technology Question 33

Practice objective / multiple choice question 33 from the 2025 City Guilds Model Questions Vol1 Information Technology examination.

City Guilds Model Questions Vol1 2025 Information Technology Objective / Multiple Choice Hard Difficulty
Question 33 CITY_GUILDS_MODEL_QUESTIONS_VOL1 • 2025 • INFORMATION_TECHNOLOGY • objective

Consider the following fragment of a program: ``` for i = 1 to n for j = 1 to i if (j mod 3 = 0) then // operation taking Θ(log₂ j) time else // operation taking Θ(1) time ``` (a) Express the total running time \(T(n)\) in Θ‑notation as a function of \(n\). (b) If each elementary operation (the Θ(1) step) takes exactly \(1\) µs and the Θ(log₂ j) step also takes \(1\) µs per unit of \(\log₂ j\), determine the largest integer \(n\) for which the program finishes within \(2\) seconds.

Answer Options

Correct Answer A. Theta(n^2); 1995
B. Theta(n^2 log n); 2500
C. Theta(n^2); 2500
D. Theta(n log n); 1500
Correct Answer
A
Correct Option:
Theta(n^2); 1995

About This Question

This is City Guilds Model Questions Vol1 2025 Information Technology Question 33. It is one of the objective questions from the 2025 City Guilds Model Questions Vol1 Information Technology examination.

Difficulty level: Hard .

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