Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitwise Manipulation or Bitwise Programming [closed]

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.

like image 504
Srikar Appalaraju Avatar asked Jan 22 '23 09:01

Srikar Appalaraju


2 Answers

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 :)

like image 154
Srikar Appalaraju Avatar answered Feb 01 '23 05:02

Srikar Appalaraju


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.

like image 34
High Performance Mark Avatar answered Feb 01 '23 05:02

High Performance Mark