Initialize pairing heap randomly
This commit is contained in:
+5
-5
@@ -161,14 +161,14 @@ struct PHeapNode *ph_deletemin(struct PHeap *ph) {
|
||||
}
|
||||
|
||||
int main() {
|
||||
srand(2309);
|
||||
|
||||
struct PHeap ph;
|
||||
ph_init(&ph);
|
||||
|
||||
ph_insert_malloc(&ph, 42);
|
||||
ph_insert_malloc(&ph, 10);
|
||||
ph_insert_malloc(&ph, 0);
|
||||
ph_insert_malloc(&ph, 100);
|
||||
ph_insert_malloc(&ph, 12);
|
||||
for (int i = 0; i < 20; i++) {
|
||||
ph_insert_malloc(&ph, rand() % 100);
|
||||
}
|
||||
|
||||
ph_print(&ph);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user