blob: 321771536d7ef7b2866027991d3b651de0014b4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <stdlib.h>
#include <stdio.h>
#include "bu/heap.h"
int main()
{
Bu::Heap<int, Bu::__basicGTCmp<int> > hInt;
for( int j = 0; j < 15; j++ )
{
int r = rand()%10;
printf("Pushing: %d, top: ", r );
hInt.push( r );
printf("%d\n", hInt.peek() );
}
for( int j = 0; j < 15; j++ )
{
printf("%d ", hInt.peek() );
hInt.pop();
}
printf("\n");
// hInt.print();
return 0;
}
|