Re: [algogeeks] towers of hanoi O(1) time

2010-06-17 Thread Anand
@Jitendra: Could not understand in which peg the plates should be. Can you please let us know On Tue, Jun 15, 2010 at 9:12 AM, Jitendra Kushwaha jitendra.th...@gmail.com wrote: Dear Anuj, Its easy to do. lets take an example say we have 4 disks. We will require 2^4-1 = 15 steps to solve

Re: [algogeeks] towers of hanoi O(1) time

2010-06-17 Thread Jitendra Kushwaha
when we get a different bit from the previous one, four condition arises defining position of the bit : consider this bit form : 1001 (from left, 1 is at odd position, then 0 at even, then next 0 at odd, and so on) now four conditions are(except for 1st bit because it has no previous bit)

Re: [algogeeks] towers of hanoi O(1) time

2010-06-16 Thread ANUJ KUMAR
I am not getting how you place a move when you get a bit that is different from previous one # A bit with a different value to the previous one means that the corresponding disk is one position to the left or right of the previous one. Whether it is left or right is determined by this rule:

Re: [algogeeks] towers of hanoi O(1) time

2010-06-16 Thread ANUJ KUMAR
please explain what happens when we get a different bit from the previous one. On Wed, Jun 16, 2010 at 4:53 PM, ANUJ KUMAR kumar.anuj...@gmail.com wrote: I am not getting how you place a move when you get a bit that is different from previous one # A bit with a different value to the

[algogeeks] towers of hanoi O(1) time

2010-06-15 Thread ANUJ KUMAR
how can we print the reconstructed configuration of the towers after k steps in towers of hanoi problem in O(1) time. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To

Re: [algogeeks] towers of hanoi O(1) time

2010-06-15 Thread Jitendra Kushwaha
Dear Anuj, Its easy to do. lets take an example say we have 4 disks. We will require 2^4-1 = 15 steps to solve it. Now suppose we are at 6th step.. write it binary form using 4 bits(since we have 4 disks) 0110 now from left 0 means 4th disk is on initial peg second bit 1 means disk 3 is on left