Documentation
¶
Overview ¶
Package arraycost solves the folowwing problem: given an array B, make up another array A, such that 1<= A[i] <= B[i] and the sum of distances between neighbour elements ( named cost ) is maximised.
Solution: the first element will either be min or maximum and recursively, for the rest of the elements, we calculate two costs: cost when the first element of the remaining ones is min, and when it is max. Then, we conclude the final cost: 1. when the first element is min, we associate it with the second cost 2. when the first element is max, we associate it with either the first or second cost
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.