Topic 5.4 Explain what the following code does: ((n&(n-1)==0)
1) If A & B==0, A and B never have a 1 bit in the same place.
2) Subtract 1 from a number:
->If the last bit is 1, impossible (unless the number is 1);
->If the last bit is 0, must only have one 1. (unless the number is 0)
3) So the code checks if n is a power of 2 (or if n is 0)