I'm watching a video on Hackerrank in regards to Big O Notation and while reading materials from the Career Cup, I always hear the term 'drop the constants'. Please let me know if I'm understanding correctly based on the algorithm below:
function whyWouldIDoThis(array){
max = NULL
for each a in array {
max = MAX(a, max)
}
print max
for each a in array {
for each b in array {
print a,b
}
}
}
It was explained that since these are two separate for loops, then the first for loops is O(n) and the second for loop is O(n^2) and since its all one algorithm then it ultimately becomes O(n^2). It makes sense that since the term 'n' is the same then they cancel out. Is this the meaning of 'dropping the contents' in terms of Big O Notation?