Skip to content

Commit c7fe697

Browse files
committed
Add explanation for the Binary Exponentiation
1 parent ae3bd72 commit c7fe697

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Maths/BinaryExponentiationIterative.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// To calculate x^n i.e. exponent(x, n) in O(log n) time in iterative way
22
// n is an integer and n >= 0
33

4+
// Explanation: https://en.wikipedia.org/wiki/Exponentiation_by_squaring
5+
46
// Examples:
57
// 2^3 = 8
68
// 5^0 = 1

0 commit comments

Comments
 (0)