Stack — 2

using Template to simulate how the Stack functions

Stack

Hanoi Tower

The formula : To move n plates, you have to move at least (2ˆn – 1) times

Recursion

Factorial

int fact(int n)
{
if(n == 0)
return (1);
else
return (n * fact(n-1));
}