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 file system allows you to continue to add files to a CD or DVD disc after the initial burn, as long as there is room on the
Sonbull [250]

Answer:

Live file system

Explanation:

The live file system allows you to continue adding files to CD or DVD disc after an initial burn as long as there is enough space left on the disc.

In an attempt to burn files on a CD or DVD disc, Windows will prompt you if you want the live file system or the other (which is mastered disc format). Once you select the live file system, you can then keep adding files over and over until there is not enough space on the disc.

Note that Windows might not display the prompt as "live file system". It could be represented in some other ways like: "Like a USB flash drive". But then going through the prompt will tell you which is which.

3 0
3 years ago
You need to design a backup strategy. You need to ensure that all servers are backed up every Friday night and a complete copy o
Katen [24]

Answer:

Full

Explanation:

You need to design a backup strategy. You need to ensure that all servers are backed up every Friday night and a complete copy of all data is available with a single set of media. However, it should take minimal time to restore data. Which of the following would be the <u>Full</u> .

3 0
3 years ago
Paragraph: Read the following two e-mail messages. In three to five sentences, explain why E-mail B is the more appropriate work
exis [7]
E-mail B is the more appropriate workplace e-mail because it’s straightforward, polite, and professional. E-mail A was more accusatory and aggressive, and many people don’t like when they’re being yelled at or accused of something and, as a result, this person may start to dislike that coworker. However, the second e-mail was more polite and made the receiver think of them as a respectful person so that they’re happy to help them out.
4 0
4 years ago
Which OS does NOT provide users with a GUI?
vesna_86 [32]
The answer is C ms-dos
Side note:
GUI means graphical user interface. In other words, that means it looks pretty and has cool buttons, animations and cute stuff. MS-DOS is just a black screen with words on it. Definitely not cute or cool.
3 0
4 years ago
Who knows a website to learn how to code in java?
Murrr4er [49]
Simple...

Although we are not allowed to link in websites..(against guidelines) you can search up codeacademy, this is a place to learn to code.

Thus, your answer.
6 0
3 years ago
Other questions:
  • Which feature of a browser will you select to block pop-ups? view help tools file
    15·2 answers
  • How do you make your graphics ADA accessible in BlueGriffon?
    12·2 answers
  • Ian recently earned his security certification and has been offered a promotion to a position that requires him to analyze and d
    6·1 answer
  • PLEASE HURRY PLEASE HELP THIS CLASS ENDS TODAY AND I NEED HELP
    7·1 answer
  • 3. Fire and police protection is the main responsibility of
    15·2 answers
  • A customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft P
    9·1 answer
  • Several programmers write individual code modules that are used for different processes in a vehicle. Individual tests have alre
    13·1 answer
  • 1. Assuming you are downloading a 100MB (800Mb) file on a Network that can download data at 54Mbps.
    15·1 answer
  • Private notes about individual slides that you leave for yourself or for others who might use the presentation file is called __
    13·1 answer
  • if a manager identifies numerous data integrity issues, she/he should consider the reports generated from that data as invalid a
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!