using Template to simulate how the Stack functions
Filed under: Data Structure | Tagged: stack, template | Leave a Comment »
using Template to simulate how the Stack functions
Filed under: Data Structure | Tagged: stack, template | Leave a Comment »
The formula : To move n plates, you have to move at least (2ˆn – 1) times
Filed under: Tips | Tagged: Hanoi_Tower | Leave a Comment »
Factorial
int fact(int n)
{
if(n == 0)
return (1);
else
return (n * fact(n-1));
}
Filed under: Tips | Tagged: recursion | Leave a Comment »