The left shift operator (<<) moves all bits to the left by a specified number of positions. New bits on the right are filled with 0.
Example: 5<<2. In binary, 5=101. Shifting left by 2 positions gives 10100=20. Notice that shifting left by k positions multiplies the number by 2k. Here, 5×22=20.
Left shift is how you quickly compute powers of 2. The expression 1<<k gives you 2k. Want 210? Write 1<<10. It's faster than calling a power function.