Consider the following nested loop construct. Categorize its efficiency in terms of the variable n using “big-o” notation. Suppose the statements represented by the ellipsis (...) require four main memory accesses (each requiring one microsecond) and two disk file accesses (each requiring one millisecond). Express in milliseconds the amount of time this construct would require to execute if n = 1024.
x = 1;
do
{ y = n;
while (y > 0)
{ ...
y--;
}
x *= 2;
} while (x <>
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here