Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If the time cost for each for loop below ( true and false conditions take the same time ) takes 1 us ( microsecond =

If the time cost for each for loop below (true and false conditions take the same time) takes 1us (microsecond =0.000001 seconds), for following code how many microseconds (us) will it take to execute if n =10?
for( int i =0; i < n; ++n)// for loop line costs 1us each time it loops once
for( int i =0; i < n; ++n)// for loop takes 1us each time it loops once
y = algorithm_01(y)// algorithm costs 10us to assigns value to y
}
}// In otherwords c the constant for each line has an actual value (e.g.1us or 10us)
What is the nearest value of the time it takes to run this loop code?
Question 3 options:
811us
101100us
122us
1121us

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions