1. Engineering
  2. Computer Science
  3. any body please explain this 4 peg of tower of...

Question: any body please explain this 4 peg of tower of...

Question details

Any body please explain this 4 peg of tower of hanoi with a diagram and code in C,C++,C# , asp.net

where s=floor(sqrt(8*n+1)-1)/2;

ALGORITHM 4 peg Towers (n S. D. Ay.A2) THEN move the discs from S to D in a lineat fashion with 2n-1 moves. ELSE DO m+1 Let m be such that s ←m +1 4-peg Towers (n-s; S, A2. D, A1) 3-peg Towers (s: S. D, A1. A2) 4-peg Towers (n-s; A2. D, S, A1) END ELSE END ALGORITHM 4-peg Towers

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution