Yes, I guess following correction in step 1 for Next Smallest should fix it: 1. Find the leftmost 1 [ Not rightmost].
On Jan 18, 12:48 am, juver++ <avpostni...@gmail.com> wrote: > @abobe > my solution is wrong when number is even (but it can be avoided with some > corrections into an implementation), > btw, you have a mistake: N=3(011), Next smallest: 6(110) ,* Should be 101 > (5)!* > > In other cases my version is correct. -- 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.