How can I explain what this pseudo code do with simple math words?

35 Views Asked by At

I would like to know how would you descriebe what this algorithm do ? And would like to know how to prove my description by induction. But I think that my description is poorly formulated.

1: if n = 0 then
2: return 1;
3: end if
4: return n · bar(n − 1);

My Answer so far: The algorithm calculates recursively the input n, until it has the value 0 and returns 1. Please give me feedback about my simple answer. What would you change?