Binary exponentiation (or exponentiation by squaring) is an algorithm that quickly computes a big power a^b in O(log(b)). This tutorial for beginners includes the intuition, examples, and two C++ implementations: recursive and iterative. Check out cp-algorithms.... for articles on more advanced algorithms.
Subscribe for more educational videos on algorithms, coding interviews and competitive programming.
Github repository: github.com/Err...
Live streams on 2nd YT channel and on Twitch: / errichto2 & / errichto
FB and Twitter: / errichto & / errichto
Frequently Asked Questions: github.com/Err...
14 окт 2024