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

  Traditional sdlc and the proposed higher level sdlc

Describe the differences between the traditional SDLC and the proposed "higher-level" SDLC. How could the higher-level SDLC be applied in your corporation?

  Analyze the benefits in selecting an operating system

Your group network plan can be supported through any network operating systems that SOPRO installs. The division supervisor wishes suggestions from the Networking Team on which OS would best suit the customers needs.

  Effectiveness of online security

Six months ago a toy corporation started to sell their items on the internet. Over this time period traffic to the website has raised substantially but few consumers have made online purchases.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Give three advantages of virtual machine

In different communications models, communication may take place using either "message passing" or "shared memory". Distinguish between "message passing" and "shared memory", illustrating your answer with a diagram Give three advantages of virt..

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Designing and coding

Prepare a database with a table called tblNames and tbl Login. The tbl Names table should have the following columns.

  Question about sarbanes oxley act in the us

Sarbanes-Oxley Act in the United States has greatly increased the compliance obligations of publicly traded corporations.

  Time slot interchange switch

In a time slot interchange switch, eight input lines are scanned in sequence to build up an input frame with eight slots.

  Individual operating systems

Discuss and explain the statement: "Global communication has developed to such a degree that the true operating system is the net itself, where the individual operating systems are just its nodes".

  What instructions would you give people in a group session

What instructions would you give people in a group session about how to get their computers to look standardized?2. What policy would you suggest for what to put on the screen so it does not offend anyone?

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