Function ADS::partitionDP

Function Documentation

inline std::optional<Nodes> ADS::partitionDP(const std::vector<long> &A)

PARTIZIONE by dynamic programming: the places of a half of A of half the sum, or nothing (exercise 19.1)

Pre:

A is not negative

Post:

the places returned are of half the sum