TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Dynamic Programming algorithms. More...
Functions | |
template<typename T > | |
bool | is_armstrong (const T &number) |
Checks if the given number is armstrong or not. | |
uint64_t | LIS (const std::vector< uint64_t > &a, const uint32_t &n) |
Calculate the longest increasing subsequence for the specified numbers. | |
std::string | lps (const std::string &a) |
Function that returns the longest palindromic subsequence of a string. | |
int | maxCircularSum (std::vector< int > &arr) |
returns the maximum contiguous circular sum of an array | |
uint32_t | trappedRainwater (const std::vector< uint32_t > &heights) |
Function to calculate the trapped rainwater. | |
Dynamic Programming algorithms.
Dynamic programming algorithms.
Namespace for dynamic programming algorithms.
For std::vector.
for std::vector
Dynamic Programming algorithm.
for IO operations
Dynamic Programming Algorithms.
for assert
for std::uint32_t
for IO operations for std::string
library for std::vector
STL library
for assert for std::pow
Dynamic Programming algorithms
for assert for std::max for std::uint32_t for io operations
Dynamic Programming algorithms
for assert for std::max for std::uint64_t for IO operations
Dynamic Programming algorithms
for assert for std::string for std::vector
for assert for IO operations
Dynamic Programming algorithms
for assert for std::uint64_t for IO operations
Dynamic Programming algorithms
for std::assert for IO operations for unordered map
Dynamic Programming algorithms
For std::min and std::max For assert For std::size_t
bool dynamic_programming::is_armstrong | ( | const T & | number | ) |
Checks if the given number is armstrong or not.
number | the number to check |
Definition at line 39 of file armstrong_number_templated.cpp.
uint64_t dynamic_programming::LIS | ( | const std::vector< uint64_t > & | a, |
const uint32_t & | n ) |
Calculate the longest increasing subsequence for the specified numbers.
a | the array used to calculate the longest increasing subsequence |
n | the size used for the arrays |
a
array of size n
Definition at line 40 of file longest_increasing_subsequence.cpp.
std::string dynamic_programming::lps | ( | const std::string & | a | ) |
Function that returns the longest palindromic subsequence of a string.
a | string whose longest palindromic subsequence is to be found |
Definition at line 31 of file longest_palindromic_subsequence.cpp.
int dynamic_programming::maxCircularSum | ( | std::vector< int > & | arr | ) |
returns the maximum contiguous circular sum of an array
arr | is the array/vector |
Definition at line 26 of file maximum_circular_subarray.cpp.
uint32_t dynamic_programming::trappedRainwater | ( | const std::vector< uint32_t > & | heights | ) |
Function to calculate the trapped rainwater.
heights | Array representing the heights of walls |
Definition at line 27 of file trapped_rainwater.cpp.