Giter Site home page Giter Site logo

brokenthorn / pothole-fill-volume-algorithm Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 44 KB

A program I wrote to find an algorithm for calculating the volume of water held in all potholes in a terrain, based on information about the terrain's elevation.

License: MIT License

C# 100.00%

pothole-fill-volume-algorithm's Introduction

PotHoleAlgorithm

A program I wrote to find an algorithm for calculating the volume of water held in all potholes in a terrain, based on information about the terrain's elevation.

Take for example this terrain information:

Demonstration

The vertical axist represents the terrain elevation at position i.

i (the position on the terrain) is represented on the horizontal axis and is an integer greater than 0 and as large as the data type allows.

Elevation values are also integers, but they are greater or equal to zero and can go as high as the data type allows. Elevations are stored in an integer array that will be given as input. The array will have 0 or more elements.

When it rains, water is accumulated in the terrain. Any watter that is not in a "pothole", drains to the ground and can be considered as having 0 volume.

The requirement is to calculate the amount of water that accumulates in the potholes in the terrain.

pothole-fill-volume-algorithm's People

Contributors

brokenthorn avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.