class GFG { public static void main(String[] args) ( int i, n 8; for (i = 1; i <= n; i=i*2) { System.out.printf ("Hello World !!!\n");

icon
Related questions
Question
1.3. Describe the worst case running time of the example codes in "big-Oh" notation in terms of the variable
Examples:
n.
2
3
4
5
6
7
O
class GFG {
}
}
public static void main(String[] args)
{
1 /** Returns the sum of the integers in given array. */
public static int example1(int[] arr) {
int n = arr.length, total = 0;
for (int i=0; j<n; j++)
total += arr[i];
int i, n = 8;
for
return total;
}
(i = 1; i <= n; i=i*2) {
System.out.printf ("Hello World !!!\n");
// loop from 0 to n-1
Transcribed Image Text:1.3. Describe the worst case running time of the example codes in "big-Oh" notation in terms of the variable Examples: n. 2 3 4 5 6 7 O class GFG { } } public static void main(String[] args) { 1 /** Returns the sum of the integers in given array. */ public static int example1(int[] arr) { int n = arr.length, total = 0; for (int i=0; j<n; j++) total += arr[i]; int i, n = 8; for return total; } (i = 1; i <= n; i=i*2) { System.out.printf ("Hello World !!!\n"); // loop from 0 to n-1
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer