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.
(a) void f1(int n) { for (int i=0; i<n; i++) { for (int j 0; j<n; j++) { for (int k-0; k<n; k++) { for (int m=0; m <n; m++) { System.out.println("!"); } } } } }
(a) void f1(int n) { for (int i=0; i<n; i++) { for (int j 0; j<n; j++) { for (int k-0; k<n; k++) { for (int m=0; m <n; m++) { System.out.println("!"); } } } } }