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) :
i am not getting what to do when we get a different bit from the
previous one someone please explain
On Mon, Jun 14, 2010 at 9:14 AM, Anurag Sharma wrote:
> Use iterative version :http://en.wikipedia.org/wiki/Tower_of_Hanoi
>
> Anurag Sharma
>
> On Mon, Jun 14, 2010 at 12:36 AM, ANUJ KUMAR
> wr
please post the solution to
http://www.spoj.pl/problems/HAN01/
--
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 unsubscribe from this group, send email to
algogeeks+unsubscr.
@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 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 it.
> Now suppose we ar
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 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 previous one means that th
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:
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
Even your own stack will give TLE :)
Try solving this question with binary solution of tower of hanoi and you
will definately pass the time limit.
--
Regards
Jitendra Kushwaha
MNNIT, Allahabad
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
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 unsubscr
Use iterative version :http://en.wikipedia.org/wiki/Tower_of_Hanoi
Anurag Sharma
On Mon, Jun 14, 2010 at 12:36 AM, ANUJ KUMAR wrote:
> http://www.spoj.pl/problems/HAN01/
> i implemented it using stack but am getting tle someone please help
>
> --
> You received this message because you are subsc
http://www.spoj.pl/problems/HAN01/
i implemented it using stack but am getting tle someone please help
--
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 unsubscribe from this g
11 matches
Mail list logo