Dynamic Programming21 sections · 916 units
Open in Course

Quiz: Optimized Power

Testing power optimization

Check Your Understanding

In the optimized power function, what do we do when nn is even?

  1. A.Return x2timestextpower(x,n2)x^2 \\times \\text{power}(x, n-2)
  2. B.Compute textpower(x/2,n)\\text{power}(x/2, n)
  3. C.Return xtimestextpower(x,n1)x \\times \\text{power}(x, n-1)
  4. D.Compute textpower(x,n/2)\\text{power}(x, n/2) and square the result
Start the roadmap to answer the quizzes and solve the challenges