big o - Writing a test program to evaluate the computational complexity(Big O) -


I used to work with the problem of writing a test program to evaluate the computational complexity of the following problem (Big O) And actually

  • A nested loop where eaach loop n times runs

    This is what I generate Was able to

     for  (int i = 0; i & lt; n; i ++) {// do stuff}   

    Now write the exam program. Can somebody help me out?

    As you have described, the complexity of the separation seems to be (N ^ 2) this "experimental" It may be possible to try to evaluate: just run algie with different values ​​and take time to calculate. Then plot the n values ​​on the time values ​​on the x-axis and y axis of a graph. Now you should make some guesses with Parabola.

  • Comments

    Popular posts from this blog

    mysql - BLOB/TEXT column 'value' used in key specification without a key length -

    c# - Using Vici cool Storage with monodroid -

    python - referencing a variable in another function? -