Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How did they get the equation (t+3c)m + 2c ? while i s m do In most situations, it is reasonable to count at unit

How did they get the equation (t+3c)m + 2c ?

image text in transcribed

while i s m do In most situations, it is reasonable to count at unit cost the test i s m, the in- structions i -1 and i -i +1, and the sequencing operations (go to) implicit in the while loop. Let c be an upper bound on the time required by each of these operations. The time l taken by the loop is thus bounded above by for i -1 + (m+1)c for the tests i s m + mt + m +mc s (t +3c)m 2c. for the executions of P(i) for the executions ofi -i+1 for the sequencing operations Moreover this time is clearly bounded below by mt. If c is negligible compared to t, our previous estimate that l is roughly equal to mt was therefore justified, except for one crucial case: V a mt is completely wrong when m 0 (it is even worse if m is negative!). We shall see in Section 4.3 that neglecting the time required for loop control can lead to serious errors in such circumstances

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_2

Step: 3

blur-text-image_3

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

Summarize the training and development process.

Answered: 1 week ago

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago