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

Related questions

0 votes
3 answers
1
asked in DS by shikharV Boss (5.1k points)   | 207 views
0 votes
2 answers
2
+1 vote
1 answer
3
asked in Algorithms by Taymiyyah Loyal (3.3k points)   | 105 views
Top Users Jan 2017
  1. Debashish Deka

    8126 Points

  2. sudsho

    5042 Points

  3. Habibkhan

    4706 Points

  4. Vijay Thakur

    4458 Points

  5. Bikram

    4348 Points

  6. saurabh rai

    4212 Points

  7. Arjun

    4010 Points

  8. santhoshdevulapally

    3722 Points

  9. GateSet

    3292 Points

  10. Sushant Gokhale

    3286 Points

Monthly Topper: Rs. 500 gift card

19,122 questions
24,033 answers
52,725 comments
20,276 users