Rekurzija
Raeunanje faktorjela rekurzivnim pozivima
f(x)=x * f(x-1), x > 1, f(1)=1
do 20 u dubinu!
function f (num) {
if (num <= 1)return 1else return num * f(num - 1)
}
{ print $0 " factorial is " f($0) }
Previous slide
Next slide
Back to first slide
View graphic version