Catalan Numbers List
Computes the Catalan numbers, of order 0 to n.
Controller: CodeCogs
Interface
C++
Catalan Numbers List
std::vector<int>catalan_numbers_list( | int | n | ) |
Example 1
#include <codecogs/maths/combinatorics/sequences/catalan_numbers_list.h> #include <iostream> int main() { std::vector<int> result = Maths::Combinatorics::Sequences::catalan_numbers_list(8); std::cout << "Number of values: " << result.size() << std::endl; for (int i = 0; i < result.size(); i++) std::cout << result[i] << " "; std::cout << std::endl; return 0; }
Output:Number of values: 9 1 1 2 5 14 42 132 429 1430
References:
SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.htmlReturns
- the Catalan numbers of order 0 to n
Authors
- Lucian Bentea (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.