Question: Multiple Chico Question > 1. (10 marks) Multiple Choice Question: 1) What is the time complexity of the following algorithm power(n,x)? Assume operation takes a
Multiple Chico Question


> 1. (10 marks) Multiple Choice Question: 1) What is the time complexity of the following algorithm power(n,x)? Assume operation takes a unit time. that long Power(int n, int x) long ans ifn -0) return 1; elsef ans Power (n/2, x)* Power (n/2, x); if(n % 2-1)ans *=x; return ans; A: (n) B: (Ign) C: (n lg n) D: (n2) n 50 1 1 2) What is the value in notation? A: (n50) B: (n51) C: (nso lg n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
