GATE CSE
First time here? Checkout the FAQ!
x
+6 votes
225 views
In the tower of Hanoi $x , y , z$ are the positions and we are to move 10 disks from $x$ to $y$. What are the $128$th and $768$th moves ?

(A) $x\rightarrow y$ and $x\rightarrow z$

(B) $x\rightarrow z$ and $z\rightarrow x$

(C) $x\rightarrow z$ and $z\rightarrow y$

(D) $x\rightarrow y$ and $z\rightarrow y$
asked in DS by Veteran (50.6k points)  
edited by | 225 views
just 4 level + 2 level traverse
what is the answer?
it should be $X$ to $Y$ ( for $128$th move)   and $Z$ to $Y$ ( for $768$th move).
......

1 Answer

+7 votes
Best answer

H(n,x,y,z) means currently we have 10 disks on x and we need to move all of them from x to y using z. 

$H(n,x,y,z) \text{ needs } (2^{n} - 1) \text{ moves using recursion}$

answered by Veteran (50.6k points)  
selected by
Answer:

Related questions



Top Users Jul 2017
  1. Bikram

    5784 Points

  2. manu00x

    3602 Points

  3. Arjun

    1988 Points

  4. Debashish Deka

    1924 Points

  5. joshi_nitish

    1908 Points

  6. pawan kumarln

    1680 Points

  7. Tesla!

    1426 Points

  8. Hemant Parihar

    1334 Points

  9. Shubhanshu

    1180 Points

  10. Arnab Bhadra

    1124 Points


24,169 questions
31,187 answers
71,039 comments
29,512 users