0% found this document useful (0 votes)
5 views2 pages

Untitled Document

The document explains time complexity as a measure of how an algorithm's running time increases with input size, aiding in the evaluation of algorithm efficiency. It also discusses asymptotic notations, which classify algorithms based on their growth rates as input sizes increase. Additionally, it provides examples of algorithms with linear and constant time complexities, demonstrating their respective time complexities of O(n) and O(1).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Untitled Document

The document explains time complexity as a measure of how an algorithm's running time increases with input size, aiding in the evaluation of algorithm efficiency. It also discusses asymptotic notations, which classify algorithms based on their growth rates as input sizes increase. Additionally, it provides examples of algorithms with linear and constant time complexities, demonstrating their respective time complexities of O(n) and O(1).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name: Reniel Carlo E Tejada Date: 2/9/24

1. What is Time Complexity?

Time complexity is a concept used in computer science to describe how the running time of an
algorithm or a program increases as the size of the input grows. It provides a way to evaluate
and compare the efficiency of different algorithms in terms of how they handle larger inputs.
By analyzing time complexity, you can better understand the performance characteristics of
algorithms and make more informed decisions about which algorithm to use for a particular
problem.

2. What is Asymptotic Notations?

Asymptotic notations are mathematical tools used to describe the behavior of functions,
particularly in the context of algorithm analysis, as the size of the input grows toward infinity.
They provide a way to classify algorithms according to their running time or space requirements
in terms of their growth rates. asymptotic notations are crucial for analyzing and comparing
algorithms, providing a clear understanding of their performance characteristics as input sizes
become very large. They allow you to describe algorithms in terms of their efficiency and
scalability.

3.Calculate the time complexity of the following algorithm, identify if its Constant
complexity or Linear complexity and draw graph to show support your answer.

1.{
int i, n = 8;
for (i = 1; i <= n; i++) {
printf("Hello Word !!!\n");
}
}

The time complexity of the given algorithm is O(n), which means it has
linear complexity.
2.Sum(a,b){
return a+b
}

Since the execution time does not depend on the size or number of inputs,
the time complexity is O(1) which is referred to as constant time complexity.

Time (T(n))

You might also like