49 q.
for_each([] (
unsigned i) { cout <<
" " << i; });
52 cout <<
"rear de 0: " << q.
rear() <<
endl
53 <<
"rear de 1: " << q.
rear(1) <<
endl
56 <<
"la cola deberia ser: " <<
endl;
58 cout << q.
get() <<
" ";
Very simple queue implemented with a contiguous array.
constexpr bool is_empty() const noexcept
Return true if the queue is empty.
T get() noexcept
Remove the oldest item of the queue.
T & putn(const size_t n) noexcept
Put n cells to the queue in constant time.
T & rear(const size_t i=0) const noexcept
Return the i-th youngest item.
void for_each(Operation &operation)
Traverse all the container and performs an operation on each element.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Circular queue implementations backed by arrays.