I want to generate the Gray code in C using the shortest recursive algorithm. Can anyone help me with it?
Thanks.
Recursive generation of Grey Code.
Started by TheUmer, Dec 02 2009 12:46 PM
5 replies to this topic
#1
Posted 02 December 2009 - 12:46 PM
|
|
|
#2
Posted 03 December 2009 - 09:51 AM
Are you having trouble with how to generate the Gray code? Gray code - Wikipedia, the free encyclopedia
Where are you stuck? What do you have so far?
Where are you stuck? What do you have so far?
#3
Posted 03 December 2009 - 10:11 AM
I already have an iterative implementation and the link you provided also directs to an iterative implementation. I'm having problem to determine the base case in the recursive implementation. What cold be the base case?
#4
Posted 03 December 2009 - 11:02 AM
You always start with all zeros, and end with a one followed by all zeros.
Also, are you recursing on the digits, or on the entire string?
Also, are you recursing on the digits, or on the entire string?
#6
Posted 09 December 2009 - 04:38 AM
good luck bro


Sign In
Create Account


Back to top









