lab_dict
Devious Dictionaries: Cleverness Through Association
 All Classes Namespaces Files Functions Variables
fac.h File Reference

Contains factorial-calculating functions both utilizing and not utilizing memoization. More...

Functions

unsigned long fac (unsigned long n)
 Calculates the factorial of the given number. More...
 
unsigned long memoized_fac (unsigned long n)
 Calculates the factorial of the given number. More...
 

Detailed Description

Contains factorial-calculating functions both utilizing and not utilizing memoization.

Author
Matt Joras
Date
Winter 2013

Function Documentation

unsigned long fac ( unsigned long  n)

Calculates the factorial of the given number.

Parameters
nNumber to calculate factorial for.
Returns
n!.
unsigned long memoized_fac ( unsigned long  n)

Calculates the factorial of the given number.

This version utilizes memoization.

Parameters
nNumber to calculate factorial for.
Returns
n!.