It is also known as Quadratic Time complexity. In this type the running time of algorithm grows as square function of input size. This can cause very large time for large inputs. Here, the notation O in O(n2) represents its worst cases complexity.
The O(N^2) time complexity means that the running time of an algorithm grows quadratically with the size of the input. It often involves nested loops, where each element in the input is compared with every other element.
A code example is:
def print_items(n):
for i in range(n):
for j in range(n):
print(i,j)
print_items(10)
When you have an algorithm like the following one where there are more scenarios and the expected notation would be O(n^2 + n) the rule is keeping only the dominan value resulting on O(n^2)
def print_items(n):
for i in range(n):
for j in range(n):
print(i,j)
for k in range(n):
print(k)
print_items(10)