GATE CSE
First time here? Checkout the FAQ!
x
+5 votes
196 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 (47.1k points)  
edited by | 196 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

+6 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 (47.1k points)  
selected by


Top Users May 2017
  1. akash.dinkar12

    3578 Points

  2. pawan kumarln

    2314 Points

  3. Bikram

    1950 Points

  4. Arjun

    1848 Points

  5. sh!va

    1682 Points

  6. Debashish Deka

    1296 Points

  7. Devshree Dubey

    1282 Points

  8. Arunav Khare

    1122 Points

  9. Angkit

    1072 Points

  10. LeenSharma

    1028 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 May 29 - Jun 04
  1. Arunav Khare

    246 Points

  2. Arjun

    198 Points

  3. pawan kumarln

    108 Points

  4. Niharika 1

    90 Points

  5. pC

    90 Points


22,909 questions
29,242 answers
65,401 comments
27,742 users