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
Convert the following into binary system<br>and vice versa.<br>106​
notka56 [123]
It would be 1101010 in binary
4 0
3 years ago
Read 2 more answers
Scenario2: Now suppose the LAN must support both voice and data and you must choose one of these multiple access strategies in o
AleksandrR [38]

Answer:

The RTP (real time protocol) which uses the UDP ( user datagram protocol) and Real-time control protocol.

Explanation:

The RTP of a voice over IP protocol (VoIP) which is used to prioritise the transfer of video and audio data over text data. It is used for video conferencing and telephony services in an enterprise.

It uses the user-datagram protocol to transfer or access videos and audio data for its real time effect and the real-time control protocol for quality of service analysis and maintenance.

4 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
If you must use a credit card while in college what are some ways you can keep from getting in credit card debt?
marin [14]

Answer:

Pay attention to what you buy and limit yourself to an amount of money everyday.

Explanation:

This is just a simple way from spending a lot and limits your everyday spendings when you actually leave an amount for yourself.

3 0
4 years ago
Topic: Drivers ed 100 points and brainliest!
ddd [48]

Answer: Ill explain it!

Explanation: Modern technology is extremely beneficial to drivers because the modern cars have sensors that detect the range of other cars, when they stop and you might not see or be ready for it, your car will slam the brakes for you, this alone saves many lives. Another is like a Tesla with autopilot. Lets say for example one day your really sleepy or dont feel good, its a stress to keep the car straight. You could turn on autopilot and it could assist you with your driving, and their system has shown to be for the most part very beneficial and responsive. I would say another would be cameras above traffic lights watching for speeders and getting their license plates. This is important because people who are being risky and causing hazards on the road will get a fat ticket and will be seeing court. They are less likely to run a red light if they see a camera watching. I hope this helps you!

3 0
3 years ago
Other questions:
  • What device acts like a wireless base station in a network, acting as a bridge between wireless and wired networks?
    11·1 answer
  • design the psuedocode for a program that allows a user to enter 10 numbers, then displays them in the reverse order of their ent
    6·1 answer
  • You approach a railroad crossing with a cross buck sign that has no light or gates . What should you do ?
    5·1 answer
  • A delimiter is used to do which of these? A. Separate two lines of data from each other. B. Separate two fields within a line of
    9·2 answers
  • What command can be used to export an nps backup file named npsconfig.xml that can be used to restore nps configuration on anoth
    12·1 answer
  • In 2-3 sentences, explain to another student why shortcuts are beneficial. Include details about shortcuts that you have used.
    10·2 answers
  • ARP only permits address resolution to occur on a single network.could ARP send a request to a remote server in an IP datagram?w
    9·1 answer
  • Abby wants to simply share a snapshot of her calendar with another user. Which option should she choose to achieve
    15·1 answer
  • What is a graph,a chart then give similarities between graph and chart.​
    6·2 answers
  • ASAP PLEASE the online research you did to describe how Senet is related to the culture and historical period when it was create
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!