Consider the following loop construct: X = 1 repeat Y = N while Y> 0 do Y = Y - 1 endwhile X = X + X until X > N * N // something (the ellipsis) Categorize its Big-O efficiency. Also, assume that the statements represented by the ellipsis take 4 milliseconds to execute. Express in milliseconds the amount of time to execute this construct for N = 2000.

icon
Related questions
Question
Consider the following loop construct:
X : = 1
repeat
Y = N
while Y> 0 do
Y := Y 1
endwhile
X = X + X
until X > N * N
// something (the ellipsis)
Categorize its Big-0 efficiency. Also, assume that the statements
represented by the ellipsis take 4 milliseconds to execute. Express
in milliseconds the amount of time to execute this construct for
N = 2000.
Transcribed Image Text:Consider the following loop construct: X : = 1 repeat Y = N while Y> 0 do Y := Y 1 endwhile X = X + X until X > N * N // something (the ellipsis) Categorize its Big-0 efficiency. Also, assume that the statements represented by the ellipsis take 4 milliseconds to execute. Express in milliseconds the amount of time to execute this construct for N = 2000.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer