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
vladimir2022 [97]
4 years ago
8

Algorithmic Complexity: what is the asymptotic complexity (Big-O) of each code section? Identify the critical section of each.\

Line 1: for (int i=0; i<532; i++) { f(n) = O( ) Line 2: for (int j=1; j
Computers and Technology
1 answer:
AleksandrR [38]4 years ago
4 0

Answer:

Check the explanation

Explanation:

1) f(n) = O( 1 ), since the loops runs a constant number of times independent of any input size

there is no critical section in the code, as a critical section is some part of code which is shared by multiple threads or even processes to modify any shared variable.This code does not contain any variable which can be shared.

2) f(n) = O( log n! ), the outer loop runs for n times, and the inner loop runs log k times when i = k,ie the total number of print will be – log 1 + log2 +log3 +log4+…...+ log n = log (1 . 2 . 3 . 4 . ……. . n ) =log n!

there is no critical section in the code, as a critical section is some part of code which is shared by multiple threads or even processes to modify any shared variable.This code does not contain any variable which can be shared.

Note : Log (m *n) = Log m + Log n : this is property of logarithm

3) f(n) = O( n^2 ), since both outer and inner loop runs n times hence , the total iterations of print statement will be : n +n+n+…+n

for n times, this makes the complexity – n * n = n2

there is no critical section in the code, as a critical section is some part of code which is shared by multiple threads or even processes to modify any shared variable.This code does not contain any variable which can be shared.

You might be interested in
What are possible consequences for cyberbullying?
BaLLatris [955]

Answer:

Possible consequences for cyber bullying include depression, isolation and illness

Explanation:

The reason for this is when a person is hurt there body tends to go through things to make them feel a certain way about things.

3 0
3 years ago
Read 2 more answers
Turn-outs are features of roadways that are to be employed by
JulsSmile [24]
<span>They are made for vehicles that are slow moving or should travel at a low speed so as not to endanger the lives of other drivers on the road, they are signs that prevent bottlenecks with slow vehicles, which for one reason or another, they cannot travel at a higher speed than others cars in the road, this mostly is noticed in cargo trucks carrying heavy cargo during a long journey.</span>
3 0
3 years ago
The _____ document, created during the requirements-gathering and analysis phase of the systems development life cycle (SDLC), i
daser333 [38]

Answer:

The answer to this question is the option "a".

Explanation:

In computer science, the term SDLC stands for Software Development Life Cycle or it is also known as the System Development Life Cycle. This process used by the software industry to produce high-quality software. It aims to produce high-quality software that fulfills customer expectations. The term system specifications is a part of the SDLC. In this part we check the software support the system or not so the answer to this question is system specifications.

6 0
3 years ago
Read 2 more answers
What is the alternative name of home page ?​
maks197457 [2]

Answer:

Home page is also known as start page

Explanation:

6 0
3 years ago
Read 2 more answers
The conclusion that ""playing violent video games leads to violent crime"" has been refuted by the American Psychological Associ
nydimaria [60]

Answer with Explanation:

There are so many studies that have been conducted in relation to the effect of playing violent video games in relation to violent crimes. However, <u>the American Psychological Association (APA) refuted this conclusion by stating that the "violent video game is a risk factor to increased aggression, however there is little evidence that it extends to committing crime or violence."</u>

This conclusion was based on several reasons that did not support the outcome of the study, such as failure in determining the outcome of playing video games between a boy and a girl. There's also a lack of study when it comes to the effect of playing video games in children younger than 10 years old. The effect of playing video game on the child's development has not been clearly studied.

These limitations made it impossible to conclude that playing video games are related to violent crimes.

4 0
3 years ago
Other questions:
  • A user complains that he cannot access a particular website, although he is able to access other websites. at which layer of the
    5·1 answer
  • How do i set up a RAID 1 array?​
    6·1 answer
  • • Write a program to find the maximum, minimum, and average score of players. The input to the program is a file containing play
    9·1 answer
  • (15 POINTS) Integrated Circuits Of Made Up Of _____ That Carry The Electrical Current.
    10·1 answer
  • Why wont it let me get another free trial on adobe photoshop?
    10·1 answer
  • You are contacted by a project organizer for a university computer science fair. The project organizer asks you to hold a forum
    10·1 answer
  • A website for a certain political party or candidate is likely to have unbiased
    6·1 answer
  • Who is maintain data and time of computer?​
    5·1 answer
  • You are creating a web page as part of a science project. Your role is to put your data on the webpage. You tracked the growth o
    12·2 answers
  • *the sticker, available in the middle section of the prescription label, will indicate if the customer requested non-safety caps
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!