Algorithms, Java, Development, Coding, Computer Science.
instructions. If we use the rule that constants don’t matter, we can drop: 2 + 2* part. And we are left with O(n^2) complexity. Rule 3. Count Instructions in the Worst-Case Scenario As I already explained, when calculating Big O, we are interested in the worst-case scenario. Let’s calculate