Skip to content

Added Binary to Gray code - #1524

Closed
Craniace wants to merge 2 commits into
TheAlgorithms:masterfrom
Craniace:master
Closed

Craniace wants to merge 2 commits into
TheAlgorithms:masterfrom
Craniace:master

Conversation

@Craniace

Copy link
Copy Markdown

Description of Change

Added a new algorithm to convert a binary number to its Gray code equivalent in the bit_manipulation directory.
The algorithm performs bitwise XOR between the binary number and its right-shifted version to generate the Gray code.

References

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
Added binary_to_gray.c — a simple and efficient implementation using bitwise operators with example and validation logic.

@github-actions

github-actions Bot commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the Stale label Dec 1, 2025
@github-actions

github-actions Bot commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions Bot closed this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant