Algorithms, Java, Development, Coding, Computer Science.
2 instructions. So function printSize has Constant Complexity or O(1). Rule 2. Constants don’t matter When calculating Big O complexity for an algorithm, we don’t care about constants. Lets count instructions for the next example: We counted: 2 + n*n*1 + n*n*1 = 2 + n^2 + n^2 = 2 + 2*(n^2)