40 for (i = 0; i < 20; i++)
69 catch (std::underflow_error)
71 cout <<
"List has been emptied"<<
endl;
Iterator over singly linked nodes.
bool has_curr() const noexcept
Return true if the iterator currently points to a node.
Singly linked list of nodes that store values of type T.
Node * get_first()
Return a pointer to the first node; throw if the list is empty.
void insert_first(Node *node)
Insert node right after this sentinel (at the beginning).
Node * remove_first()
Remove the first node of the list.
Singly linked node that stores data of type T.
T & get_data()
Return a modifiable reference to the stored data.
Snode *& get_next()
Return the next node after this.
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.
Singly linked list with typed nodes.