When we write an algorithm, it's important to know how much time it will take to execute and how much memory it will use.
For this, we study its complexity based on the size of data to process, which we often denote n.
An algorithm is said to have linear complexity when it performs a number of operations proportional to the data size.
Examples:
An algorithm is said to have quadratic complexity when it performs a number of operations proportional to the square of the data size.
Examples: