Recursion code for generating Gray Code in C
1. The problem statement, all variables and given/known data
I need to implement a recursive code for generating the Gray code for a given number of bits. For example, if the input bit is 1 it generates Gray code for 1 bit number i.e 0 and 1. Given 2, it generates Gray code for 2 bit numbers i.e 00 and 01 and so on. I don't understand how to implement and what should be the base case.
I'd be really grateful in case of any help.
2. Relevant equations
3. The attempt at a solution