TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Implementation of the Trapped Rainwater Problem More...
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <vector>
Go to the source code of this file.
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.
Definition in file trapped_rainwater.cpp.
int main | ( | void | ) |
Main function.
Definition at line 101 of file trapped_rainwater.cpp.
|
static |
Self-test implementations.
Definition at line 62 of file trapped_rainwater.cpp.