void towersofhanoi(char source,char dest,char auxiliary,int n)
{
if(n == 0)
return;
else
towersoffhanoi(source,auxiliary,dest,n-1);
printf("%c to %c \n",source,dest);
towersohanoi(auxiliary,dest,source.n-1);
}
On Tue, Sep 20, 2011 at 11:07 PM, prasanth n <[email protected]> wrote:
> @don:
> yes it think
>
>
> On Tue, Sep 20, 2011 at 11:00 PM, Don <[email protected]> wrote:
>
>> Does the call stack count as a stack?
>>
>> Don
>>
>> On Sep 20, 12:27 pm, prasanth n <[email protected]> wrote:
>> > In the classic problem of the Towers of Hanoi, you have 3 rods and N
>> disks
>> > of different sizes which can slide onto any tower. The puzzle starts
>> with
>> > disks sorted in ascending order of size from top to bottom (e.g., each
>> disk
>> > sits on top of an even larger one). You have the following constraints:
>> > (A) Only one disk can be moved at a time.
>> > (B) A disk is slid off the top of one rod onto the next rod.
>> > (C) A disk can only be placed on top of a larger disk.
>> > Write a program to move the disks from the first rod to the last using
>> > Stacks.
>> >
>> > --
>> > *prasanth*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> *prasanth*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.