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
Write about storage<br>(should be in easy words)​
enyata [817]

Answer:

Answer to the following question is as follows;

Explanation:

The process of storing digital information in a data storage media using computing technology is known as storage. Storage is a technique that allows a computer to keep data indefinitely or intermittently. Computer storage capacity and electronic data management are other terms for storage.

6 0
2 years ago
What is the QOS model?
Andre45 [30]

Answer:

Quality Of Service

Explanation:

Technology that manages data traffic to reduce packet loss, latency and jitter on the network. QoS controls and manages network resources by setting priorities for specific types of data on the network.

5 0
3 years ago
I have been trying to use brainly recently but i cant because everytime i watch an ad to get an answer, its an interactive ad, s
Troyanec [42]

Answer:

remove ads

Explanation:

by buying a no ad pack

5 0
2 years ago
Which best describes a computer bug?
yanalaym [24]

Answer:

a piece of computer software containing defects that prevent a program from running properly

Explanation:

i got a 100% on the test

6 0
3 years ago
Someone help me please
MA_775_DIABLO [31]

Answer:

I think it is the last 2 but i am not 100% sure.

Explanation:

3 0
3 years ago
Other questions:
  • If you find yourself boxed in by a vehicle on your left or right _____________
    14·2 answers
  • Which of the following has likely attended vocational school?
    10·1 answer
  • The front surface of the CCD is called the _________
    11·1 answer
  • You are running out of storage space on one of your servers. you need to purchase an external hard drive, as there are no drive
    8·2 answers
  • What types of tools are used in the process of a digital or network investigation?
    12·1 answer
  • If i hit the delete key three times what will be left
    12·1 answer
  • You need to update your router settings, so you log into the administration panel, Whose Internet protocol (IP) address is 192.1
    5·1 answer
  • I WILL GIVS BRAINLIEST IF U ANSWER THIS
    9·1 answer
  • A researcher is interested in learning more about the different kinds of plants growing in different areas of the state she live
    8·1 answer
  • Choose the best answer from the options below to complete the following sentence.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!