Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

consider the followimg nested loop contruct. Categorize the efficiency in terms

ID: 3549047 • Letter: C

Question

consider the followimg nested loop contruct. Categorize the efficiency in terms of the variable n using "big-O" notation. Suppose the statements represented by the elipsis (...) require four main memory accesses (each requiring one microsecond) and two discs file accesses (each requiring one millisecond). Express in milliseconds the amount of time this construct would require to execute if n were 1000.

consider the followimg nested loop contruct. Categorize the efficiency in terms of the variable n using "big-O" notation. Suppose the statements represented by the elipsis (...) require four main memory accesses (each requiring one microsecond) and two discs file accesses (each requiring one millisecond). Express in milliseconds the amount of time this construct would require to execute if n were 1000.

Explanation / Answer

x = 1; do { y = n; while (y > 0) { ... y--; } x *= 2; } while (x