Algorithms icon indicating copy to clipboard operation
Algorithms copied to clipboard

Add new Algorithm - Fast Exponentiation Algorithm (in JAVA)

Open dis-GU-ise opened this issue 11 months ago • 1 comments
trafficstars

Add Fast Exponentiation (Exponentiation by Squaring) Algorithm to the Java Algorithm Template

Problem: Currently, the Java algorithm template does not include an efficient implementation of the fast exponentiation algorithm (also known as exponentiation by squaring). This algorithm is important for efficiently calculating large powers in algorithms related to number theory, cryptography, and modular arithmetic.

Proposed Solution:I suggest adding an implementation of the fast exponentiation algorithm to the Java algorithm template. This algorithm should be able to handle both positive and negative exponents efficiently. The time complexity of this algorithm is O(log n), making it much faster than the naive O(n) approach.(under a certain module)

dis-GU-ise avatar Dec 25 '24 06:12 dis-GU-ise

Please @dis-GU-ise Assign this issue to me.

KunjMaheshwari avatar Jan 26 '25 05:01 KunjMaheshwari