Open Nkap23 opened 3 years ago
Modular exponentiation is used to compute pow(n1,n2)%mod (n1^n2%mod) in log(n2) time!
This algorithm computes pow(n1,n2) in log(n2). The normal algorithm would take O(n2) times. This O(n2) is not feasible when n2 is larger than 10^7 or 10^8. So this algorithm is a must when dealing with large numbers!
I believe this algorithm is one of the basic yet one of the most used algorithms used. I want to contribute and add this algorithm to this repo, so in the future newcomers can refer to it and understand it.
I request Project Admins/Mentors to assign the issue to me. @tarun26091999
go ahead with CPP
Thank you for assigning. I followed the contributions rules and made a PR for the code! https://github.com/Algo-Phantoms/Algo-Tree/pull/293
Request you to review it!
I would like to work on this issue in C++, please assign it to me.
I would like to work on this issue in c++, please assign it to me.
I would like to work on this issue in Java. Kindly assign it to me @raksha009
I would like to work on this issue in Python. Kindly assign it to me @plazzy99
Modular exponentiation is used to compute pow(n1,n2)%mod (n1^n2%mod) in log(n2) time!
This algorithm computes pow(n1,n2) in log(n2). The normal algorithm would take O(n2) times. This O(n2) is not feasible when n2 is larger than 10^7 or 10^8. So this algorithm is a must when dealing with large numbers!
I believe this algorithm is one of the basic yet one of the most used algorithms used. I want to contribute and add this algorithm to this repo, so in the future newcomers can refer to it and understand it.
I request Project Admins/Mentors to assign the issue to me. @tarun26091999
Edit: PR: https://github.com/Algo-Phantoms/Algo-Tree/pull/293