hw abt this?

start from right most bit..

 if it is the right most bit and if its 0 then flip it and proceed to
the prev. bit
else
flip the rightmost zero to 1 and invert the subsequent bits
follow the above proc. till the left most bit is flipped to 1.


correct me if m wrong!!

-- 
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.

Reply via email to