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.
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.
Related questions
Question

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
