|
Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Compute double factorial: \(n!!\). More...
#include <cassert>#include <iostream>Functions | |
| uint64_t | double_factorial_iterative (uint64_t n) |
| uint64_t | double_factorial_recursive (uint64_t n) |
| int | main () |
| main function | |
Compute double factorial: \(n!!\).
Double factorial of a non-negative integer n, is defined as the product of all the integers from 1 to n that have the same parity (odd or even) as n.
It is also called as semifactorial of a number and is denoted by \(n!!\)
| uint64_t double_factorial_iterative | ( | uint64_t | n | ) |
| uint64_t double_factorial_recursive | ( | uint64_t | n | ) |
Compute double factorial using resursive method.
Recursion can be costly for large numbers.