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

feat: Add Gray Code Conversion Algorithm using Bit Manipulation #6790

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Acuspeedster
Copy link
Contributor

Fixes issue:

lack of gray code convertor in the xor algorithms #6789

Changes:

  • Added the Gray code conversion algorithm that converts a binary number n to its Gray code equivalent using the following operation: n ^ (n >> 1).
  • Provided a detailed description and explanation of how the algorithm works and its use cases.
  • Optimized for efficiency with constant time complexity (O(1)).

@Acuspeedster
Copy link
Contributor Author

@AdiChat Review this please.

@Acuspeedster
Copy link
Contributor Author

Copy link
Member

@AdiChat AdiChat left a comment

Choose a reason for hiding this comment

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

Remove the binary file.

code/bit_manipulation/src/output/gray_code_conversion.exe

@Acuspeedster
Copy link
Contributor Author

@AdiChat I am done with the changes.

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