@gene
plz explain .. what is going on... by taking example..... i am unable to run
a test case
1. x=0xAD (1010 1101)
2. x<<1 ===>01011010
|
x>>1 ====>01010110
x = 01011110
how we will get
answer as ( 0101 1011).....??????
On Sun, Nov 21, 2010 at 9:59 AM, Gene <[email protected]> wrote:
> if the input is in unsigned char x, then
>
> x = ((x << 1) & 0xAA) | ((x >> 1) & 0x55)
> x = ((x << 2) & 0xCC) | ((x >> 2) & 0x33)
>
> On Nov 20, 10:41 pm, Divesh Dixit <[email protected]>
> wrote:
> > assuming all are 8bit no.
> > input = 0x46 (0100 0110)
> > output = 0x26 ( 0010 0110 )
> > input = 0x75 (0111 0101)
> > output = 0xFC (1110 1010 )
> >
> > Algorithm..???
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>
--
*Divesh*
(¨`·.·´¨) Always
`·.¸(¨`·.·´¨ ) Keep
(¨`·.·´¨)¸.·´Smiling!
`·.¸.·´" Life can give u 100's of reason 2cry,but u can give life 1000's
of reasons 2Smile"
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.