Describe the worst-case running time of the following code in “big-Oh” notation in terms of the variable n.
Posted: Fri Jul 08, 2022 6:35 am
Describe the worst-case running time of the followingcode in “big-Oh” notation in terms of the variable n.
(b) void f2(int n) { for (int i=0; i<n; i++) { for(int j 0; j < 10; j++) { for (int k=0; k<n; k++) { for (int m=0; m < 10; m++) { System.out.println("!"); } } } } }
(b) void f2(int n) { for (int i=0; i<n; i++) { for(int j 0; j < 10; j++) { for (int k=0; k<n; k++) { for (int m=0; m < 10; m++) { System.out.println("!"); } } } } }