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
kifflom [539]
3 years ago
12

2.Consider the following algorithm and A is a 2-D array of size ???? × ????: int any_equal(int n, int A[][]) { int i, j, k, m; f

or(i = 0; i < n; i++) for( j = 0; j < n; j++) for(k = 0; k < n; k++) for(m = 0; m < n; m++) if(A[i][j]==A[k][m] && !(i==k && j==m)) return 1 ; return 0 ; } a. What is the best-case time complexity of the algorithm (assuming n > 1)? b. What is the worst-case time complexity of the algorithm?
Computers and Technology
1 answer:
Elis [28]3 years ago
5 0

Answer:

(a) What is the best case time complexity of the algorithm (assuming n > 1)?

Answer: O(1)

(b) What is the worst case time complexity of the algorithm?

Answer: O(n^4)

Explanation:

(a) In the best case, the if condition will be true, the program will only run once and return so complexity of the algorithm is O(1) .

(b) In the worst case, the program will run n^4 times so complexity of the algorithm is O(n^4).

You might be interested in
What is a computer dedicated to a single function, such as a calculator or computer game? A. TabletB. PDAC.ApplianceD. Minicompu
viktelen [127]

Answer:

C. Appliance.

Explanation:

When a device or machine performs a single function or task, it is commonly referred to as an appliance. Examples of such is an iron, a calculator, a computer game, washing machines, refrigerators, e.t.c

<em>A Personal Digital Assistant (PDA)</em>, is a device, mostly mobile and handheld, that combines various computing features such as telephoning and networking. An example is a tablet. A PDA performs more than a single function.

<em>Minicomputer</em> is a computer usually small in physical size, that is midway in capabilities and support, between a microcomputer and a mainframe computer. An example is also a tablet and our smartphones. Minicomputers are also dedicated to various functions rather than a single function.

In summary, the option that best describes the situation in the question is an appliance.

<em>Hope this helps!</em>

6 0
3 years ago
When was the Ethics Resource Center (ERC) established? In the 1970s In the 1980s In the 1990s In the 2000s
baherus [9]

Answer:

1922

Explanation:

i looked it up When was the Ethics Resource Center (ERC) established?

4 0
3 years ago
Which of the following is another name for cinematographers? (Select all that apply). lighting specialists production manager di
JulijaS [17]

Answer:

camera operators

directors of photography

Explanation:

Cinematography is simply the art of taking photos and being in charge of cameras in the process of film-making.

There are alternative names for a cinematographer and they include camera operators and directors of photography

3 0
3 years ago
Where is the BIOS chip located?
masya89 [10]

Answer:

on the motherboard inside the computer

6 0
3 years ago
Read 2 more answers
Hello pls answer<br><br><br>what is the use of loop in java​
xxMikexx [17]
The use of loop in java is to run a block of code for a certain number of times.
7 0
2 years ago
Other questions:
  • Which type of loop only runs while a condition is true?
    11·2 answers
  • Discus the pros and cons of Internal cloud service and External cloud service for both Infrastructure as a service and Applicati
    11·1 answer
  • The main benefit of encryption of a hard drive is to make part of an ROI report.
    15·1 answer
  • 15. The text of a desktop publishing document is often created using
    6·2 answers
  • Listed items that are not in any particular order should be identified with _____.
    9·1 answer
  • In C++ write a program that prints out PI as a type double and a type float EXACTLY as shown below. Your program should have ONE
    13·1 answer
  • HELP ASAP!!!
    7·1 answer
  • Write 4 types of viruses , explain them briefly.
    7·1 answer
  • Taylor and Rory are hosting a party. They sent out invitations, and each one collected responses into dictionaries, with names o
    9·1 answer
  • Leslie’s parents put a big dry-erase board on the refrigerator and let the kids write suggestions for how to organize and assign
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!