-
Notifications
You must be signed in to change notification settings - Fork 126
Added logarithmic Exponentiation Implementation #62
base: master
Are you sure you want to change the base?
Added logarithmic Exponentiation Implementation #62
Conversation
29e4303
to
1f4519d
Compare
Hi @prachiagrawal269 Travis CI's test failed, please correct the issues. |
@aktech @CuriousLearner The build for this pull request is failing for higher versions of python (3.2 and above). |
@@ -9,3 +9,4 @@ | |||
from .binary_search import binary_search | |||
from .linear_search import linear_search | |||
from .queue import queue | |||
from .logarithmic_exponentiation import logarithmic_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.
Add a newline here
@CuriousLearner @aktech If we are integrating this, I think |
@malayaleecoder number 100 in binary can be represented as 1100100 i.e. it requires just 7 bits for its representation. Hence logarithmic exponentiation would just require just 7 iterations to compute 100^100. So I don't think its a domain issue that is taking long time. |
@prachiagrawal269 Actually I was referring to the |
result = result*base | ||
|
||
base = base*base | ||
exponent = exponent/2 |
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.
Using //
operator would perform integer division, which is the required behavior.
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.
Thanks @goelakash
The error got fixed.
@prachiagrawal269 Please resolve the conflicts. |
73adf6c
to
bd1cbec
Compare
Merge conflicts removed. |
@prachiagrawal269 Please squash the commits. |
Added logarithmic Exponentiation Implementation reduced the domain for tests operator modified for integer division merge conflicts removed
…iagrawal269/pydsa into logarithmic-exponentiation
See if it's good to go now. @prachiagrawal269 Once you do changes, remember to ping someone so that your PR could be reviewed. |
from .stack import Stack | ||
from .radix_sort import radix_sort | ||
from .stack import Stack | ||
from.radix_sort import radix_sort |
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.
needs a space between from
and .radix_sort
@CuriousLearner The commits aren't squashed yet. @prachiagrawal269 Here's a guide to squashing git commits - http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html |
@aktech Please review
references #12