## Big-O Complexity

This is the algorithm’s worst-case complexity.

Time complexity – It is defined as the number of times a particular instruction has been executed rather than the total time taken by the entire program execution.

Space Complexity – It is defined as the total memory required by a program for its execution.

## Types of Time Complexities

There are 3 types of time complexities that exist.

1] Best Time – It is the minimum time taken by the algorithm. Ex. if you are performing a linear search, if the element is present at the beginning of the array.

2] Average Time – It is averaged over all possible inputs. It’s calculated by dividing the total computing time for all inputs by the total number of inputs.

3] Worst Time – It is the maximum time taken by the algorithm. Ex. if you are performing a linear search, if the element is present at the last position of the array.

## Notation for Time Complexities

1] Omega notation(Ω):- This notation describes the best-case scenario of the algorithm.

2] Theta notation:- This notation describes the average-case scenario of the algorithm.

3] Big-O notation (O): – This notation describes the worst-case scenario of the algorithm.