Step 1 - Start
Step 2 - C ← A + B + 10
Step 3 - Finish
Here we have three variables A, B and C and a constant. Therefore: S (P) = 1 + 3 .
Now, the amount of memory will depend on the data type of the given variables and constants and will equal the product of the total with the memory for the corresponding data type.
The time factor of an algorithm represents the amount of run time required from the beginning until the end of an algorithm. The required time can be represented by a function T (n) , where T (n) can be evaluated as the number of steps.
For example, the addition of two n-bit integers will have n steps. Therefore, the total calculation time will be T (n) = c * n , where c is the time to perform two-bit addition. Here, we consider the function T (n) to increase linearly when the input data size increases.
According to Tutorialspoint
Previous article: What is SQL
Next lesson: Asymptotic analysis in Data Structure and Algorithm