1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ksju [112]
3 years ago
15

What is the big-O performance estimate of the following function?

Computers and Technology
2 answers:
larisa [96]3 years ago
8 0

Answer:

The time complexity of the code is O(log₇n).

Explanation:

The i is updated by 7*i.On each iteration i is multiplied by 7.So on finding the time complexity of the code given above it will come out to  be log base 7.

When we divide the input by 2 the time complexity is log base 2.

So on dividing it by 7 we get the time complexity of log base 7.

Digiron [165]3 years ago
4 0

Answer:

Since the loop index variable i is initialized to 0, this function will result in infinite execution for all values of n>=0.

If instead the loop index variable is initialized to 1, Big O performance estimate of the code is O(log n) with logarithm base as 7.

Explanation:

Given function:

int f (n) {

int sum = 0;

for (i = 0; i < n; i = 7 * i)

sum += i;

return sum;

} // end f

The complexity is determined by the for loop. Starting value of the index variable i is 0.  At each iteration the value of the index variable i is multiplied by 7 (i=7*i). But multiplication by 7 still leaves the value of the index variable as 0. So loop condition i<n will fail for all n>=0 and the loop will continue indefinitely since the termination condition will never be achieved.

However if the loop index variable i is initialized to 1 instead, the loop will run O(log n) times with 7 as the base of the logarithm due to successive multiplication of index variable by 7 at each iteration.

You might be interested in
How Extreme Programming addresses Software Testing andevolution ?
kumpel [21]

Answer:

Extreme programming is a software development technique which is used to enhance software quality and it's response to ever changing customer requirements.

Testing

Testing is main focus in extreme programming.Extreme programming addresses testing in a way that if a minute testing can eliminate a bit of flaws, extensive testing can terminate a lot of flaws.

Evolution in Extreme programming is like this:-

Coding:-First programmers will code the problem.

Testing :- Testing is done to remove flaws.

Listening:- Programmers must listen to the customers to what they need.

Designing:-Then design according to the customer needs.

6 0
3 years ago
Practicing touch typing allows you to create documents efficiently and accurately.
Marysya12 [62]
I think the answer to this would be true
8 0
2 years ago
This is a device that enables computers to be connected to a network.
zhuklara [117]

The answer to your question is,

NIC - Network Interface Card

-Mabel <3

8 0
3 years ago
State the function of a URL in a website​
mihalych1998 [28]

Answer:

It's purpose is to access a webpage.

Explanation:

A URL contains detailed information on the webpage such as, the domain name, protocol, and path. This information directs the browser to the desired page.

3 0
3 years ago
Explain why database management systems are used in hospitals? Discuss
Sergeeva-Olga [200]

The reason why database management systems are used in hospitals is because the use of Healthcare databases aids in terms of diagnosis and treatment, handle documentation and billing, and others.

<h3>What is a database management system in healthcare?</h3>

A database management system (DBMS) is known to be a type of software that has been developed to help people to form and keep databases.

It is one that helps to lower the risk of errors associated with medical operations and management. It reduces  paperwork and staff and also improves  performance.

Learn more about database management from

brainly.com/question/24027204

8 0
2 years ago
Other questions:
  • The project started the development of inter-network connections using tcp/ip that has evolved into the internet today.
    5·1 answer
  • To create a new query in Design view, click CREATE on the ribbon to display the CREATE tab and then click the ____ button to cre
    9·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
    12·1 answer
  • I am doing 7th grade coding 3.02 assignment can anybody help me it says bad input on line 3 and this is what it is can someone h
    6·1 answer
  • -1
    13·1 answer
  • What are some good digital habits?
    5·2 answers
  • What is data analysing data and give three examples ?​
    9·1 answer
  • which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
    9·1 answer
  • Universal Containers wants to use a sandbox with real data in it. Which Sandboxes three would you recommend?
    11·1 answer
  • 100 POINTS!!!!!!!
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!