Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java, Consider the following loop construct: X := 1 repeat Y := N while Y > 0 do . . . // something (the

Using Java, Consider the following loop construct: X := 1 repeat Y := N while Y > 0 do . . . // something (the ellipsis) Y := Y - 1 endwhile X := X + X until X > N * N Categorize its efficiency in terms of the variable N using big-O notation. Also, assume that the statements represented by the ellipsis require four main memory accesses with each access requiring 1 microsecond, and two disk file accesses with each requiring 1 millisecond. Express in milliseconds the amount of time this construct would require to execute if N = 1000.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

Students also viewed these Databases questions

Question

Discuss briefly the advantages and disadvantages of a CFD contract.

Answered: 1 week ago

Question

Effective Delivery Effective

Answered: 1 week ago