-
Notifications
You must be signed in to change notification settings - Fork 257
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
Fast Exponentiation Algorithms Added #2
base: master
Are you sure you want to change the base?
Conversation
Includes binary exponentiation for numbers and Matrix exponentiation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment your code to the implemented code. A unit test would help us to guarantee the code functionality.
cin>>a>>n; | ||
cout<<power(a,n); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you possibly implement the unit test for this algorithm and put it in the corresponding C++ unit test folder?
@@ -0,0 +1,29 @@ | |||
#include<bits/stdc++.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a meaningful header and also some informative comments to different parts of the code to be more readable.
@@ -0,0 +1,80 @@ | |||
//for more info refer : https://www.spoj.com/problems/MPOW/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a meaningful header and also some informative comments to different parts of the code to be more readable.
} | ||
return 0; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you possibly implement the unit test for this algorithm and put it in the corresponding C++ unit test folder?
Includes binary exponentiation for numbers and Matrix exponentiation.