Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Algorithm - Fast Exponentiation Algorithm (in JAVA) #739

Open
dis-GU-ise opened this issue Dec 25, 2024 · 0 comments
Open

Add new Algorithm - Fast Exponentiation Algorithm (in JAVA) #739

dis-GU-ise opened this issue Dec 25, 2024 · 0 comments

Comments

@dis-GU-ise
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant