mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 05:21:49 +03:00
less code
This commit is contained in:
parent
8914128e13
commit
74c091b1aa
@ -5,11 +5,7 @@
|
||||
// Function for Tower of Hanoi algorithm
|
||||
void hanoi(int noOfDisks, char where, char to, char extra)
|
||||
{
|
||||
if (noOfDisks == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
if (noOfDisks != 0)
|
||||
{
|
||||
hanoi(noOfDisks - 1, where, extra, to);
|
||||
printf("Move disk : %d from %c to %c\n", noOfDisks, where, to);
|
||||
|
Loading…
Reference in New Issue
Block a user