Cou3306 Saq 02
Cou3306 Saq 02
Looking at how much space (or memory) an algorithm needs (space complexity)
Looking at how much time it takes to finish a task (time complexity)
Its refers to the total time taken for a program to run until it completes its task.
And this is estimate by counting the number of basic steps performed by the
algorithm during execution.
04. Name three factors, other than input size, that influence the time complexity of an
algorithm.
Because it allows comparing the running time of two algorithms without actually
writing two programs and running them on the same computer
06. In the context of growth rate, explain why we often approximate the running time of
an algorithm by ignoring lower-order terms.
The main term of the runtime often far outweigh the importance of lower-order
terms, especially as and taken on large values, therefore, we can summarize or
abstract away information by giving a “growth rate” or bound on the algorithms
performance.
123585511
07. What are the three types of time complexity analysis and briefly describe each?
Worst case : The worst case defines the case which the algorithm takes huge
time.
Best case : Best case defines the case which the algorithm takes lowest time.
Average case : Average case provides a prediction about the running time of
the algorithm.
08. What is operation count, and how is it used to estimate time complexity?