Skip to content

Add a bitwise conversion for DecimalToBinary. #380

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

Merged
merged 1 commit into from
Feb 19, 2018
Merged

Add a bitwise conversion for DecimalToBinary. #380

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
Contributor

@varunu28 varunu28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Update the indentation to 4
  • Merge all commits into 1

@petersonddb
Copy link
Contributor Author

@varunu28 Done.

Copy link
Contributor

@varunu28 varunu28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants