Runtime $\mathcal{O}(n^2)$ | Slow sorting O(n x n) Quadratic time

As we double N the output would be multiplied by 4, which is 2 squared.

Typically associated with nesting loops.

count = 0
for i in range(0, N):
for j in range(i+1, N):
if a[i] + a[j] == 0:
count += 1

from stopwatch import Stopwatch

i = 1
total_operations = 0
while i < N:
j = 1
while j < N:
total_operations += 1
j += 1
i += 1

if __name__ == '__main__':
input_sizes = [100, 200, 400, 800, 1600, 3200]
for input_size in input_sizes:
timer = Stopwatch()

What you should see from the output is as you double your input the runtime is multiplied by 4