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 a bitwise conversion for DecimalToBinary. #380

Merged
merged 1 commit into from Feb 19, 2018

Conversation

@petersonddb
Copy link
Contributor

@petersonddb petersonddb commented Feb 17, 2018

This adds a (not pure) bitwise approach, which is more efficient than a conventional approach (it does not need any division operation), to convert from decimal to binary. It also creates an interface to ease the choose between conventional and bitwise methods.
I have a pure bitwise approach in another branch but it is less efficient (because the loops and method calls).

Copy link
Collaborator

@varunu28 varunu28 left a comment

  • Update the indentation to 4
  • Merge all commits into 1
@petersonddb
Copy link
Contributor Author

@petersonddb petersonddb commented Feb 17, 2018

@varunu28 Done.

Copy link
Collaborator

@varunu28 varunu28 left a comment

You can try to simplify the user input. You don't need to remove the existing code which handles the user input

@petersonddb
Copy link
Contributor Author

@petersonddb petersonddb commented Feb 19, 2018

Take a look.

@varunu28 varunu28 merged commit ff43b36 into TheAlgorithms:master Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.