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