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 IO operations | |
Functions | |
template<class T > | |
T | math::n_choose_r (T n, T r) |
This is the function implementation of \( \binom{n}{r} \). | |
static void | test () |
Test implementations. | |
int | main (int argc, char *argv[]) |
Main function. | |
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.