I know the concepts of bit-wise operators, bit manipulation, 2's complement etc. But when it comes to solving something using bit manipulation it does not strike me. I takes me time to wrap my head around them.
I thought it would help if I looked at some questions regarding bit operators/bit manipulation but it left me even more confused as to how to approach this topic. I am not looking for an answer to a specific problem but a generalized approach / mindset while tackling bit manipulation. Thanks.
Answers given so far are nowhere near useful. But the link given by Naveen helped me a bit. Quite a lot of examples given here. I am trying to learn from them. Maybe it'll help others.
Bit Hacks
UPDATE: I have been going through the examples given in the link above. They were good. Also I stumbled on - Resource for Bitwise Programming link in SO. Excellent Resource. After going through all those resources I feel bitwise programming is easy! Never thought I would use that in a sentence :)
I divine your question to be:
What approach should I take, and what mindset should I adopt, when tackling problems involving bit manipulation ?
If that is correct, read on, if not, stop now ...
Bit manipulation is a difficult topic for the beginner such as me. I will have to concentrate hard and pay careful attention as I work through a graded set of sample problems. I will revise what I learn at regular intervals.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With