Hello, assuming I have a value of n that is a power of 2, what is the quickest way to find which bit is set?
Is there anything faster than a simple iteration such as
int temp = 0;
for (int i = n; i > 1; i >>= 1, temp++) { }
Thanks
Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answers
Know the answer? Post it. Somebody with the same question will find it here.