see this http://geeksforgeeks.org/?p=726
On Fri, Jul 22, 2011 at 4:29 AM, adhyetha <ranjith.kaga...@gmail.com> wrote: > reverse(int n) > { > int i, result = 0; > > for(i = 0; i < 32; i++) > result |= ((n >> i) & 1) << (31 - i); > } > > > .... assuming 32 bit integer to be reversed and assuming all 32 bits > to be reversed.. i.e 100101 reverses to > 10100100000000000000000000000000 > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.