<aside> 🪆 Recursive functions are implementations of a recursive algorithm, where the function makes a call to itself to perform each individual, smaller step.

</aside>

Basic Structure

returntype recfct( input to algorithm ) {
	if( base-case ) 
		return-base-value
	result = work from this call
	recursion = recfct( reduced data )
	return "result" combined with "recursion"
}

Factorial Example

int f( int n ) {
	if( n<=1 ) 
		return 1 ;
	int r = f( n-1 ) ; // we could also write:
	return n * r ; // return n * factorial( n-1 ) ;
}