DEV Community

Discussion on: Intro to Big O Notation 👀

Collapse
 
mshel profile image
MikhailShel • Edited

the last example should have
for (var j = 1; j <= n; j++) {
or
for (var j = 1; j <= i; j++) {
for 2'd loop

to be O(n2). That's critical. Any constants in Big O notation can be dropped

Collapse
 
sait profile image
Sai gowtham

Updated