Page 1 of 1

For each of the below code snippets, identify the asymptotic runtime (i.e., big-Oh) of the code segment: (a) (2 points)

Posted: Sat May 14, 2022 8:25 pm
by answerhappygod
For Each Of The Below Code Snippets Identify The Asymptotic Runtime I E Big Oh Of The Code Segment A 2 Points 1
For Each Of The Below Code Snippets Identify The Asymptotic Runtime I E Big Oh Of The Code Segment A 2 Points 1 (72.8 KiB) Viewed 45 times
For each of the below code snippets, identify the asymptotic runtime (i.e., big-Oh) of the code segment: (a) (2 points) int a = 0; int b = 0; int m - non; 01 On On? On while(a <n) logn On login a-a+1; Other: while(b < m/100) b=b+1; ооо On On O (b) (2 points) for (i = 0; i<n; i++) for(j = 0; j <i; j++) arr += arr[j]; 01 On On On One logn On logn 02" Other: (c) (2 points) for (i = 0; i < 1000; i++) { for(j = 0; j <i; j++) { arr[j] [k] - 0; } } 1 On On On On logn On logn O 2 Other: n (d) (2 points) for (i = 1; i<n; i=i*3) for(j = 0; j<n; j++) printf( "Hello world\n"); 01 On On On3 logn on login O 21 Other: On n (e) (2 points) int rec( int n) { if( n<=1 ) return 0; return 1 + rec(n/3); /* rec call / } On On On On logn On logn 02n Other: