57 try { n =
stoi(
argv[1]); }
catch (...) { n = 1000; }
62 cerr <<
"n must be positive" <<
endl;
66 unsigned int t = std::time(0);
69 try { t =
stoul(
argv[2]); }
catch (...) { t = std::time(0); }
74 cout <<
"testBinHeap " << n <<
" " << t <<
endl;
80 for (i = n - 1; i >= 0; i--)
88 for (i = 0; i < n; i++)
98 for (i = n - 1; i >= 0; i--)
103 cout <<
value <<
" ";
109 for (i = 0; i < n; i++)
118 for (i = n - 1; i >= 0; i--)
127 for (i = 0; i < n/2; i++)
134 for (i = n - 1; i >= 0; i--)
142 for (i = 0; i <= n + n/2; i++)
149 catch (exception & e)
151 cout << e.what() <<
endl;
161 for (i = 2*n - 1; i >= 0; i--)
170 for (i = 0; i < n/2; i++)
185 for (i = 0; i < n/2; i++)
195 while (heap.
size() > 0)
204 for (i = n - 1; i >= 0; i--)
211 for (i = 0; i < n; i++)
219 cout <<
"End" <<
endl;
Core header for the Aleph-w library.
size_t size_t int32_t value
virtual bool verify_heap(Node *p) const
Node * getMin()
Removes the node with the lowest priority from the heap.
Node * remove(Node *node)
Removes node from the heap.
void remove_all_and_delete() noexcept
Deletes all the nodes of the heap, invokes the destructors of the removed nodes, and frees all the me...
Node * insert(Node *p) noexcept
Inserts a node into a heap.
const size_t & size() const noexcept
DynArray< Graph::Node * > nodes
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
Node heap without virtual destructor.
BinHeapNode< Key > Node
The heap's node type.
static void printNode(BinHeap< int >::Node *node, int, int)
Binary heap implementation using tree structure.
Utility functions for binary tree operations.
Lazy and scalable dynamic array implementation.