Big-O: Examples in Code

The following video was done by Derek Banas on YouTube. It does an excellent job of giving real world examples of how to do Big-O analysis on various code blocks in java.



1 point
What is the Big O of this piece of code?

class NestedForLoop {
   public static void main(String[] args) {
      
      for (int i = 1; i <= 5; ++i) {

         System.out.println("Outer loop iteration " + i);

         for (int j = 1; j <=2; ++j) {
            System.out.println("i = " + i + "; j = " + j);
         }
      }
   }
}