Exponentiation

Understand the efficiency and effectiveness of the exponentiation algorithm.

Naïve method

Given a number aa and a positive integer nn, suppose we want to compute ana^n. The standard naïve method is a simple for loop that performs n1n − 1 multiplications by aa:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy