What is the value of x after execution? int n = 841; int x = 1; for (i = 0; i < 50; i++) { int nx = (x + n / x) / 2; X =
Posted: Sat May 14, 2022 8:32 pm
How to solve these ?
What is the value of x after execution? int n = 841; int x = 1; for (i = 0; i < 50; i++) { int nx = (x + n / x) / 2; X = nx; } Pick ONE option 14 O 70 O 17 29 Clear Selection 2. Time Complexity 2 What is the time complexity of this code? int temp = 0; for (int i = 0; i<n; i++) { for (int j = 0; j<imi; j++) { for (int k = 1; -k; k -= 1) { temp++; } Pick ONE option O O(n) O O(n) C oins logn O O(n)
What is the value of x after execution? int n = 841; int x = 1; for (i = 0; i < 50; i++) { int nx = (x + n / x) / 2; X = nx; } Pick ONE option 14 O 70 O 17 29 Clear Selection 2. Time Complexity 2 What is the time complexity of this code? int temp = 0; for (int i = 0; i<n; i++) { for (int j = 0; j<imi; j++) { for (int k = 1; -k; k -= 1) { temp++; } Pick ONE option O O(n) O O(n) C oins logn O O(n)