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
Natali5045456 [20]
3 years ago
5

Give a big-O estimate for the number of operations,

Computers and Technology
1 answer:
Kazeer [188]3 years ago
6 0

Answer:

Explanation:

For the first iteration of i for loop 1 to n, the j for loop will run from 2 to n times. i.e. n-1 times.

For the second iteration of i for loop, the j for loop will run from 3 to n times. i.e. n-2 times.

From the third to the last iteration of i for loop, the j for loop will run n-1 to n times. i.e. 2 times.

From the second to the last iteration of i for loop, the j for loop will run from n to n times. i.e. 1 time.

For the last iteration of i for loop, the j for loop will run 0 times because i+1 >n.

Hence the equation looks like below:

1 + 2 + 3 + ...... + (n-2) + (n-1) = n(n-1)/2

So the number of total iterations is n(n-1)/2.

There are two operations per loop, i.e. Comparison and Multiplication, so the iteration is 2 * n(n-1)/2 = n ^2 - n

So f(n) = n ^ 2 - n

f(n) <= n ^ 2 for n > 1

Hence, The algorithm is O(n^2) with C = 1 and k = 1.

You might be interested in
A hacker corrupted the name:IP records held on the HOSTS file on a client, to divert traffic for a legitimate domain to a malici
balu736 [363]

The type of attack that the hacker performed is Domain Name System (DNS) server cache poisoning.

<h3>What is DNS poisoning?</h3>

In Domain Name System (DNS) server cache poisoning, the hackers often enter into a DNS server because they want to make an adjustment to its directory so that it can point the domain name users enter to a wrong, IP address.

Note that Domain Name Server (DNS) poisoning is a form of system attack in which there is the change of DNS records which are then used to redirect online traffic to a wrong website.

Learn more about hacker  from

brainly.com/question/24956493

7 0
2 years ago
Question 4. Use simulate_several_key_strikes 1000 times, each time simulating the monkey striking 11 keys. Compute the proportio
Arisa [49]

Answer:

Chech the explanation

Explanation:

<em>In [16]:</em>

<em />

# Your answer to this question might be written on more than a line.

datascience_trials = make_array()

for  i  in np.arange(1000):

            datascience_trials = np.append(datascience_trials, simulate_several_key_strikes(1))

datascience_proportion = np.count_nonzero(datascience_trials == 'datascience')/1000

datascience_proportion

<em>Out [16]:</em>

0.0

<em>In [17]:</em>

_ = ok.grade('q2_4')

````````````````````````````````````````````````````````````````````````````````````````````````````````

#Running tests

4 0
3 years ago
Which is the order of steps for attaching an item to a contact?
aivan3 [116]
We need to know what item and then we can answer ur question
5 0
3 years ago
Read 2 more answers
Gabe just won the lottery after ten years of consistently buying a ticket every Friday. Based on his initial reaction of feeling
ludmilkaskok [199]
The answer is D. cortisol level would most likely decrease.                                                                                                                                                                             

5 0
3 years ago
Read 2 more answers
In video game development, the person who oversees and directs the entire design team and is the key vision keeper is
Sav [38]

Answer:

The Lead Designer

Explanation:

The Lead designers main role is to oversee how a game looks and is played. They manage a, normally small, design team. They work with them to come up with many aspects of the game itself like; characters, props, and plots to the game. they also, makes sure that the team itself stays on track, is within budget, and meets the designated deadlines.

3 0
3 years ago
Other questions:
  • It is either snoming or below freezing
    10·1 answer
  • Oxygen-18 has an atomic number of 8. How many neutrons are in this isotope?
    7·1 answer
  • Which of the following correctly orders the investments from LOWER risk to HIGHER risk?
    7·2 answers
  • Which of the following software programs provides for e-mail communication?. A. Access. B. Word Perfect. C. Outlook. D. Excel
    15·2 answers
  • The Internet and World Wide Web allow almost any business to be global. What are two important results of this process?
    8·1 answer
  • If anything is changed on an already-tested module, regression testing is done to be sure that this change hasn’t introduced a n
    13·1 answer
  • How can you enter Task Manager in Windows? Select 3 options. press Ctrl + Shift + Tab press Ctrl+Alt+Delete and then click Task
    8·1 answer
  • Please help! would appreciate it very much!
    13·1 answer
  • Write 5 things that can be done to avoid computer vision syndrome
    8·2 answers
  • You are purchasing a new printer. Which of the following is the most important requirement?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!