What is a Program Step

For Complete YouTube Video: Click Here

This class will try to understand What is a Program Step.

We have already discussed the time complexity of an algorithm in our previous class.

Without understanding the instance characteristics that we have discussed in our previous class, you may not be able to know what we discuss in this class.

What is a Program Step

A Program Step is defined as a syntactically or semantically meaningful segment of an algorithm that has an execution time that is independent of the instance characteristics.

To understand this consider the algorithm shown below.

What is a Program Step 1
What is a Program Step 1

In the above algorithm, consider the first line code.

The first line of code is both syntactically or semantically meaningful, and for that execution of the code, we are not considering the instance characteristics.

This line of code in the algorithm is called the program step.

To find an algorithm’s time complexity, we will count the number of program steps.