What is the overall big-o of this algorithm?

Assignment Help Operating System
Reference no: EM13164953

some code you wrote takes 8009887n log n + 56n + 3n + 2640945n8 steps to execute, where n is the input size. What is the overall Big-O of this algorithm? Explain your answer. (You do not have to use the formal definition here.)

Part B:

For each of the following code snippets, assume X represents some segment of code that takes a fixed number C of steps to execute. Express the total number of steps taken by the code as a function of the variable n (i.e., find the function that we called T(n) in class), and indicate the Big-O of that function.

Example: Do this analysis for the code snippet

for (int i = 0; i < n; i++) {

X

}

 

Here, the total number of steps is T(n) = Cn (since the loop repeats n times, each one of which performs C steps), and the corresponding Big-O would be O(n) since T(n) is a linear function of n.

a. for (int i = 0; i < 2*n; i++) {

X

X

}

for (int i = n; i > 0; i--) {

X

}

b. X

while (n > 1) {

X

n = n/2;

}

 

c. int i = 0;

while (i < 500) {

X

System.out.println(i);

X

i++;

}

 

 

 

Reference no: EM13164953

Questions Cloud

Program that will read in such an array : Write a program that will read in such an array, and repeatedly prints it so the user can select the direction in which to move next. The user's requested move can prompt a number of responses
Terrorist groups sprung up around the globe : Why have terrorist groups sprung up around the globe? What kinds of governments and policies make for a breeding ground for this type of "resistance"?
Calculate the molarity of ascorbic acid in the solution : A solution containing 82.0 g of ascorbic acid dissolved in 230 g of water has a density of 1.22 g/mL. Calculate the molarity of ascorbic acid in the solution.
Best strategy would be to become aggressive on price : Inc. has finished a new video game, Snowboard Challenge. Management is now considering its marketing strategies and Which strategy is best: Do nothing and follow the advise of Mark Hobson
What is the overall big-o of this algorithm? : What is the overall Big-O of this algorithm?
How many grams of sodium carbonate present after reaction : A solution containing 3.50 of sodium carbonate is mixed with one containing 5.00 of silver nitrate. How many grams of sodium carbonate are present after reaction?
A method that takes a two-dimensional array : A method that takes a two-dimensional array of int's as a parameter and searches the array for the second parameter, returning true if the second parameter matches any of the integers in the array, and false otherwise.
How many grams of carbon dioxide are produced : how many grams of carbon dioxide are produced when 2.50g of sodium hydrogen carbnate reacts with excess citric acid according to the equation: 3NaHCO3 + H3C6H5O7 -> Na3C6H5O7 + 3CO2 + 3H2O.
Neurophysiological and evolutionary : Provide a framework for the theoretical concepts associated with Donald Hebb the Neurophysiological and Evolutionary write 200-300 cite references

Reviews

Write a Review

Operating System Questions & Answers

  Stateful inspection packet filtering routers

Name two benefits of Stateful Inspection Packet Filtering Routers. Name two benefits that firewalls add to a network

  Automatic diagnostic system

Sommerville recommended that objects manipulated through users should be drawn from their own domain rather that an computer domain.

  Internal application server for application systems

Classic Catalog Corporation runs a small but rapidly increasing catalog sales business. It outsourced its Web operations to a local ISP for many years but as Web have become a larger portion of its business,

  Dns security measurements

Having a Domain Name Server available to the public can be a tool in the hand for attackers. If anyone is able to use your Domain Name Server, they can use it to send a huge amount of traffic to their victim.

  Priority scheduling in operating system

priority scheduling in operating system

  Approaches to organizing programming teams

Explain 3-approaches to organizing programming teams. For what types of assignments or development activities is each approach best suited?

  Programming language machine independence

Discuss and explain the main factors that influence programming language machine independence, and how higher levels of machine independence could be achieved.

  Asymmetric encryption algorithm

Discuss and explain how the asymmetric encryption algorithm can be used to achieve the following targets:

  Question about deadlock

A system has five active procedures(A-E) and one type of resource, which there are two-hundred total unites available in the system.

  Ethical, legal and security responsibilities

Determine some of the ethical, legal and security responsibilities health care organizations must address when they implement health care database?

  Creating the sample database

nstall DB2 Express-C, construct the model database, and validate the installation and write a short paper describing your experience with the installation.

  Virtual machines

Virtual machines supported by a host operating system

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd