MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / calculate_max_values

Function calculate_max_values

src/dynamic_programming/trapped_rainwater.rs:35–43  ·  view source on GitHub ↗

Determines the maximum heights from either direction in the elevation map. # Arguments `elevation_map` - A slice representing the heights of the terrain elevations. `reverse` - A boolean that indicates the direction of calculation. - `false` for left-to-right. - `true` for right-to-left. # Returns A vector containing the maximum heights encountered up to each position.

(elevation_map: &[u32], reverse: bool)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

trapped_rainwaterFunction · 0.85

Calls 3

create_iterFunction · 0.85
maxMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected