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
What would you guess is the shape of the distribution based only on the computer output? explain
Contact [7]

The guess in the shape of the distribution based only on the computer output is known to be  Skewed to the right because the mean is known to be bigger.

<h3>What is meant by skewed distributions?</h3>

A skewed distribution is said to be one whose data values is one that tend to trail off more sharply on a single side than on the other.

Skewed data is one that do take place as a result of a lower or an upper bounds on the data.

Note that data possess a lower bound when they are skewed to the right and an upper bound when they are skewed left.

Hence, The guess in the shape of the distribution based only on the computer output is known to be  Skewed to the right because the mean is known to be bigger.

Learn more about Skewed distribution   from

brainly.com/question/24055593

#SPJ1

6 0
2 years ago
1.Computer Architecture and their examples . 2. what are the three system bus​
Aneli [31]

Answer:

WHAT IS  THIS QUESTION?

Explanation:

Please tell,e or I will

^45*7353_=+233

7 0
2 years ago
Jak mogę usunąć swoje konto?
frez [133]

Answer: Jeśli przejdziesz do ustawień i prywatności

3 0
3 years ago
Read 2 more answers
5. Robotics deals with the design, construction, operation, and use of robots, as well as computer systems for their control, se
Law Incorporation [45]

The answer would be

True

3 0
3 years ago
Given the following code segment, what is output after "result = "? int x = 1, y = 1, z = 1; y = y + z; x = x + y; cout &lt;&lt;
Katyanochek1 [597]

Answer:

The answer is "Option b".

Explanation:

  • In the C++ language program code, there are four integer type variable is defined that is "x, y,z, and result" in which variable x,y,z holds a value that is "1" and the variable result does not hold any value.  
  • In the next line, variable y holds added value of variable y and z, which is equal to 2. and variable x holds added value of variable x and y, which is equal to 3.
  • In the next line, a Ternary Operator is defined, it is similar to an if-else statement. This operator checks if x variable value is less then y. If this condition is true, it will print y variable value Otherwise, it will print x variable value. That's why the out to this question is "option b".
4 0
3 years ago
Other questions:
  • A _______ is used to analyze and summarize your data without graphical support.
    10·1 answer
  • Write a program that prompts the user to enter a three digit integer and determine whether it is a palindrome number.
    12·1 answer
  • A pen testing method in which a tester with access to an application behind its firewall imitates an attack that could be caused
    14·1 answer
  • I just wanted to know what are some of the challenges that could arise from setting up a file management system on a computer
    11·2 answers
  • 20 PTS URGENT!!! Derek’s organization uses an emerging technology that uses specialized software to place an image on an object,
    6·2 answers
  • To move the insertion point to another location on the screen, users can use:
    13·2 answers
  • Which option should you select to accept a tracked change? A. Accept B. Reject C. Review D. Delete
    8·2 answers
  • Smart phones and Smart watches are same functions due to?
    12·1 answer
  • How many triangles can you make if the side lengths are 4 cm, 5 cm, and 11 cm?
    10·1 answer
  • To read encrypted data, the recipient must decipher it into a readable form. What is the term for this process?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!