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]
3 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]3 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
Please help I’ll give brainleistt
iren2701 [21]

Answer:

7. B

8. A

9. B

10. B

11. A

Explanation:

6 0
2 years ago
There are several different types of RAM, each with its own purpose. Name the three types of RAM and briefly describe their func
Neko [114]
Well we have SRAM(Static Random Access Memory) is faster, have a lower density but it is more expensive.
While DRAM(Dynamic Random access memory) is just the opposite.
Those are the only two, I know exist.
3 0
3 years ago
Read 2 more answers
Which directory in the FHS stores programs and configuration information that can only be executed and modified by the root user
dlinn [17]

Answer: /sbin

Explanation:

In Linux, FHS describes the directory content and the way in which Operating System files are displayed to the user.

/sbin is a directory that contains executable programs. s/bin is the short form of system binaries. System binaries require root rights to perform specific tasks. /sbin contains binaries that are crucial to boot the system and also to recover and restore the system. /bin directory also contains the commands to boot the system but the main difference between both is that /sbin programs can only be executed by the root user. Examples are fdisk, fsck, root,halt, init, grub, ifconfig.

4 0
3 years ago
Fill in the blank - A generation of social-oriented, physical games such as the _______ Wii console, emerged in the late 2000s,
disa [49]

Answer:

wild bro just need points

Explanation:

6 0
3 years ago
What are some random fun facts about Technology?
Lana71 [14]

Answer:

i do not know

Explanation:

but it helps to communication

5 0
2 years ago
Other questions:
  • Fair use allows individuals to break copyright so long as they ________.
    15·1 answer
  • 2) Search the Web for two or more sites that discuss the ongoing responsibilities of the security manager. What other components
    15·1 answer
  • What is the first priority when building or using vex robots
    10·2 answers
  • 2 examples of miniature storage media ?
    8·2 answers
  • What dose a company’s code of ethics cover
    9·2 answers
  • Please help!! I need this asap! thank you so much!! &lt;3
    6·1 answer
  • I'm trying to move the figure a little away from, the column line and every time I move it and click ok it goes back to being be
    11·1 answer
  • Database accessibility DBA writes subschema to decide the accessibility of database.
    13·2 answers
  • Describe your previous personal or professional experience with Microsoft Word.
    9·1 answer
  • Why do you want to work for Rev?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!