Binary Exponentiation: Explanation for dummies like me
Jun 24, 2023 · 2 min read · The Binary Exponentiation is a trick to calculate \(a^n\) in O(logn) instead of O(n) Let's see \(a^n\),\(a^n \) equals the value of 1 multiplied by a, n times. This process takes O(n) operations we can do this quickly using binary exponentiation. $$a...
Join discussion