Shortcut for chapter specific information

Tuesday, June 28, 2011

Measurement in 4.1-3

Final measurement of the two algorithms n-square and nlogn.  In my case the crossover point is 67.  There is no change after combining with the base case.  Why should it be? Except the extra logic of the if statement that one would put, it doesn't seem to make sense that the cross over would change.

All the conditions are measured seconds and in each condition, the algorithm was exercised for 100k times.

          n^2     nlogn
N=10      0.080   0.116
N=50      0.728   0.836
N=62      0.732   1.020
N=65      1.100   1.116
N=66      1.100   1.116
N=67      1.148   1.144  (*crossover point*)
N=68      1.188   1.156
N=75      1.388   1.288
N=76      1.418   1.308
N=78      1.492   1.424
N=82      1.620   1.408
N=88      1.852   1.536
N=100     2.352   1.812
N=1000  170.210  19.391

I consider myself finished 4.1-3. 

2 comments:

  1. Hey how u compute the complexity of your program...means is their any software or addon in IDE ...
    Please give any suggestions...

    ReplyDelete
  2. You don't measure complexity. Complexity is something you figure out on paper. That's a theoretical value.

    What you can measure is how long the execution time of a certain algorithm, to do that you just need to implement a timer.

    ReplyDelete