Algorithm Analysis Examples 3

For Complete YouTube Video: Click Here

In this class, we will try to understand Algorithm Analysis Examples 3.

We have already discussed some examples of algorithm analysis in our previous class.

Algorithm Analysis Examples 3

Algorithm 1

Algorithm Analysis Examples 3 - 1
Algorithm Analysis Example – 1

The above algorithm has three for loops.

The outermost for loop will n times.

Every time we enter the outermost for loop, the inner loop will iterate for i2 times.

Every time we enter the inner loop, the innermost loop will iterate for n/2 times.

The efficiency of the algorithm is n4.

The math behind the efficiency of the algorithm is explained in the YouTube link provided on top.

Algorithm 2

Algorithm Analysis Examples 3 - 2
Algorithm Analysis Example – 2

The math behind the efficiency of the above algorithm is explained in the YouTube link provided on top.