Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Implementation of the Trapped Rainwater Problem More...
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <vector>
Namespaces | |
namespace | dynamic_programming |
Dynamic Programming algorithms. | |
Functions | |
uint32_t | dynamic_programming::trappedRainwater (const std::vector< uint32_t > &heights) |
Function to calculate the trapped rainwater. | |
static void | test () |
Self-test implementations. | |
int | main () |
Main function. | |
Implementation of the Trapped Rainwater Problem
This implementation calculates the amount of rainwater that can be trapped between walls represented by an array of heights.
int main | ( | void | ) |
|
static |
Self-test implementations.