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

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  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.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  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.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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