Page 1 of 1

58. What is the time complexity of this pseudocode? for (int i=1;j<=n;j++) \{ int j=n​​ while (j>=1) \{ cout <
Posted: Thu Jul 14, 2022 2:27 pm
by answerhappygod
58 What Is The Time Complexity Of This Pseudocode For Int I 1 J N J Int J N While J 1 Cout J 2 I J 1
58 What Is The Time Complexity Of This Pseudocode For Int I 1 J N J Int J N While J 1 Cout J 2 I J 1 (21.17 KiB) Viewed 32 times
58. What is the time complexity of this pseudocode? for (int i=1;j<=n;j++) \{ int j=n​​ while (j>=1) \{ cout <<j%2 i j/=2​ i 3 cout << endli \} a. Q(n∗n) b. O(log(n)) c. O(n∗ m) d. Q(n∗log(n)) 59. ???????????????| 60. What is the time complexity of this pseudocode? Algorithm Algo2(A) Input: An nxn matrix of integers with n>=1 Output: The sum of the integers in the matrix s=0 for j=1 to n do for j=1 to no s=Σ+A[j][j] return s a. Q(nlogn) b. O(n∧2) c. Q(logn) d. O(1) 61. Which sorting algorithm works by repeatedly swapping adjacent elements if they are out of order? a. Bubble b. Radix c. Shell d. Bucket