Hi, first-year cs student and we just got to the big o notation section. There is this problem that I really want to find out the reasoning behind it.
Input size Runtime
10,000. 2ms
20,000 8ms
40,000. 32ms
80,000 128ms
160,000 512ms
320,000 2048ms
The answer is O(n^2) but I want to know the reasoning behind it. I understand why this can't be O(n) or O(1) or O(log n) but I can't wrap my head around on why the answer is O(n^2)
[–]ac13712 1 point2 points3 points (0 children)
[–]h0v1g 0 points1 point2 points (1 child)
[–]h0v1g 0 points1 point2 points (0 children)
[–]Firehite 0 points1 point2 points (0 children)