Comparing Algorithms - Asymptotic Bounds and Limits

Consider the loop:
//Code taking C instructions
for (int i = 0; i < X; ++i) {
    //code - takes K instructions

Obviously whatever instructions are inside the loop is executed X times. Let’s say the instructions executed inside the loop take K instructions to run. Thus the execution time of the loop is C+X*K.

Now, let’s look at another code snippet:

read more

Algorithms, Winlab Programming Talks