|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Combinations n choose r function implementation More...
#include <cassert>#include <iostream>Namespaces | |
| namespace | math |
| for std::rand | |
Functions | |
| template<class T > | |
| T | math::n_choose_r (T n, T r) |
| This is the function implementation of \( \binom{n}{r} \). More... | |
| static void | test () |
| Test implementations. More... | |
| int | main (int argc, char *argv[]) |
| Main function. More... | |
Combinations n choose r function implementation
A very basic and efficient method of calculating choosing r from n different choices. \( \binom{n}{r} = \frac{n!}{r! (n-r)!} \)
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
|
static |
Test implementations.