Is the same solution as the Hannoi towers, you're starting with 3 pegs
and 2 discs. Both discs are in the first peg and you need to transfer
them to the second peg maintaining the constraints, the output being
3
1 3
1 2
3 2

. you need 3 moves (1st line)
. first move is 1->3 or move the top disc from the 1st peg to the 3rd
peg (config now is 1 3)
. second move 1->2 or move the top disc (was the bottom disc
originally) of the 1st peg to the 2nd peg (config now is 2 3)
. third move 3->2 move the disc in the 3rd peg to the 2nd peg
finishing with both discs in the 2nd peg as needed (config now is 2 2)





On Apr 26, 10:06 pm, Umer Farooq <the.um...@gmail.com> wrote:
> Hi everyone,
>
> I was just going through a sample question on interview street and I came
> across this question.
>
> Attached file contains the sample question. It is just an advanced version
> of towers of hannoi. However, the case00 are quite confusing.
>
> Can anyone please explain us how did they manage to get such an output on
> case00?
>
> --
> Umer
>
>  interviewStreetQues.docx
> 25KViewDownload

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

Reply via email to