63int main(
int argc,
char *argv[])
66 unsigned int t = std::time(0);
71 n = std::stoi(argv[1]);
74 t = std::stoi(argv[2]);
83 cout <<
"n must be positive" << endl;
89 cout << argv[0] <<
" " << n <<
" " << t << endl;
96 for (i = n - 1; i >= 0; i--)
106 for (i = 0; i < n; i++)
117 for (i = n - 1; i >= 0; i--)
119 value = (int) (n*100.0*rand()/(RAND_MAX+1.0));
128 for (i = 0; i < n; i++)
137 for (i = n - 1; i >= 0; i--)
139 value = (int) (n*100.0*rand()/(RAND_MAX+1.0));
148 for (i = 0; i < n/2; i++)
156 for (i = n - 1; i >= 0; i--)
158 value = (int) (n*100.0*rand()/(RAND_MAX+1.0));
166 for (i = 0; i < n + n/2; i++)
Core header for the Aleph-w library.
size_t size_t int32_t value
Node * insert(Node *p) noexcept(nothrow_cmp)
Inserts a node into a heap.
Node * getMin()
Removes the node with the lowest priority from the heap.
Main namespace for Aleph-w library functions.
Node heap without virtual destructor.
bool operator<(const Foo &r)
bool operator<=(const Foo &r)
Binary heap implementation using tree structure.
Utility functions for binary tree operations.