44 return (
static_cast<Dnode<int>*
>(p)->get_data() <
56 catch (...) { n = 1000; }
62 cerr <<
"Error: n must be a positive integer." <<
endl;
66 unsigned int t = std::time(0);
70 try { t =
static_cast<unsigned int>(
stoul(
argv[2])); }
71 catch (...) { t = std::time(0); }
76 cout <<
argv[0] <<
" " << n <<
" " << t <<
endl;
80 for (
int i = 0; i < n; ++i)
88 cout << it.get_curr()->get_data() <<
" ";
93 cout << n/2 <<
" se encuentra en la lista" <<
endl;
95 cout << n/2 <<
" no se encuentra en la lista" <<
endl;
101 cout << n/2 <<
" se encuentra en la lista" <<
endl;
103 cout << n/2 <<
" no se encuentra en la lista" <<
endl;
108 cout << it.get_curr()->get_data() <<
" ";
115 cout <<
"El elemento " << n/2 <<
" es: " << ptr->
get_data() <<
endl;
size_t size_t int32_t value
bool has_curr() const noexcept
Return true if the iterator has current item.
Doubly linked circular list node.
void remove_all_and_delete() noexcept
Remove and free memory for all the items of list.
void append(Dlink *node) noexcept
Insert node before this.
bool check()
Return true if the list is consistent.
Iterator on a list of Dnode objects.
Node belonging to a double circular linked list with header node.
T & get_data() noexcept
Return a modifiable reference to the data contained in the node.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
long random_search(T *a, const T &x, const long l, const long r, const Compare &cmp=Compare())
Random search for an element in an array.
bool operator()(Dlink *p, Dlink *q) const
Comprehensive sorting algorithms and search utilities for Aleph-w.