NetApp Interview Question
Software Engineer / Developersi have 1101 bit
1111
lets xor it
1011
1111
-----
0100
-----
do you think this will reverse it??
You wrote your XOR operands wrong! What you wanted was to XOR 1101 (and not 1011) with 1111.
Therefore, 1101 ^
1111
-----------
0010, which is the reverse.
bitwise left to right bitmask scan, and sum those scan with right to left bitwise scan?
- Zaphod February 23, 2010if someone suggest better idea? optimization may be dependent on ISA i think