Bit Manipulation - Gray Code
What is the time complexity of generating an n-bit Gray code sequence using the optimal bitwise formula
[i ^ (i >> 1) for i in range(1 << n)]?[i ^ (i >> 1) for i in range(1 << n)]?15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions