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
svetlana [45]
3 years ago
10

Given the following Java code:

Computers and Technology
1 answer:
lubasha [3.4K]3 years ago
3 0

Answer:

See explaination

Explanation:

{1, 2}

Runs only once for 1 < 2

{10, 20, 30}

Runs 1 for 10 < 20

Runs 1 for 10 < 30

Runs 1 for 20 < 30

Total 3 times

{30, 20, 10}

Runs 1 for 30 < 20

Runs 1 for 30 < 10

Runs 1 for 20 < 10

Total 3 times

{-4, 7, 1}

Runs 1 for -4 < 7

Runs 1 for -4 < 1

Runs 1 for -7 < 1

​​​​​​​Total 3 times

Generalizing it will run for n*(n-1)/2 so for 2 element it will run for 2*1/2 = 1

For 3 element it will run for 3*2/2 = 3 times

(ii) (3 points) For an array of size , what is the big-oh runtime of this code in the worst case?

Time complexity in Worst case is O(n^2). Reason being it uses two for loop where first loop runs for n time and the second loop runs for n*n time in worst case hence its O(n^2)

You might be interested in
Which programming languages are the best choices for desktop applications? Select 3 options.
slega [8]
The three are Python c and html
5 0
3 years ago
Read 2 more answers
Which type of digital picture is made by strong individual pixel value
8_murik_8 [283]

Answer  :a bitmap because it is a 'map' of where the 'bits' of information are stored

Explanation:

This information is stored as a sequence of numbers defining the colour of each pixel.

8 0
3 years ago
Read 2 more answers
You want to get information about DNS request types and DNS query packet content. What kind of DNS logging do you need to enable
ololo11 [35]

Answer:

Option C i.e., Analytic event logging is the correct answer.

Explanation:

The user required to enable Analytic event logging Type of DNS logging to take data or information related to the type of DNS request and also the content packet of the DNS query. By Analytic event logging, Users get data about the forms of DNS requests and the size of the DNS query packets. That's why the following option is correct.

8 0
3 years ago
A certain program takes 26.67 seconds to run on 3 processors and 16 s to run on 7 processors. Find the execution time on one pro
brilliants [131]

Answer:

The explanation for the question is listed in the section below on Explanation.

Explanation:

The time needed for a program to execute in 26.67 seconds on 3 processors. Time expected to run the program, therefore, should be as follows:

The time to run on one processor = \frac{26.67}{3} = 8.89 seconds.

The time needed for a program to execute in 26.67 seconds on 7 processors, should be:

Time = \frac{16}{7} = 2.2857 seconds.

Whenever the amount of processors increases the performance or speed should increase.

The time is taken in percentage = \frac{26.67}{16}×100% = 170 %

As the number of processors increases from 3 to 7, the time required according to each processor increases by 70%.

In one processor the execution time should be as follows:

26.67+(26.67×0.7) = 45.339

                              = 45 seconds

Therefore. the execution period for a single processor is about 45 seconds.

The work is performed in parallel, whereas the program is already being parallelized. The overall function ought to be shared between the processor. The time is shortened to around half. Hence the duration taken will be 8 seconds after parallelization.

Theoretical execution time would be Tp > T infinity.

Thus, T infinity<45

The theoretical processing interval on processor count P1/2 would therefore be less than 8 seconds. Because, the time required during parallelization was just that.

5 0
3 years ago
Which of the following is a goal of summarizing?
zhannawk [14.2K]

Answer:

b

Explanation:

its B mygee

5 0
3 years ago
Other questions:
  • Write a recursive, int -valued function, len, that accepts a string and returns the number of characters in the string .
    7·1 answer
  • ______ is the software that prevents people from being able to access your personal information.
    8·2 answers
  • When you're working with a word processing document and you press the del key, what happens?
    6·2 answers
  • What do astronomers call a system that is composed of more than two stars?
    9·2 answers
  • DRAG DROP -A manager calls upon a tester to assist with diagnosing an issue within the following Python script:#!/usr/bin/python
    11·1 answer
  • A period in which unemployment is low, business produces many goods and services, and wages are good is called ______.
    8·1 answer
  • How to create a trace table
    10·1 answer
  • Online education provides _____.
    8·1 answer
  • The ___________ method returns the length of an array.
    11·2 answers
  • Integrated circuits incorporate many transistors and electronic circuits on a single tiny silicon chip, allowing ____ to be even
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!