When you write
1 << n
You shift the bit combination 000000001
for n
times left and thus put n
into the exponent of 2:
2^n
So
1 << 10
Really is
1024
For a list of say 5 items your for
will cycle 32 times.
When you write
1 << n
You shift the bit combination 000000001
for n
times left and thus put n
into the exponent of 2:
2^n
So
1 << 10
Really is
1024
For a list of say 5 items your for
will cycle 32 times.