next up previous contents
Next: Useful scripts Up: Driver programs Previous: debug_driver.cc

pq_driver.cc

Pq_driver is used to benchmark a priority queue in the hold model. The benchmarking is done by repeatedly extracting the top element from the queue, and reinserting it after decreasing its priority by some random value. The timing is reported on stdout in a format suitable for gnuplot and a checksum of the extracted elements are written on stderr. The checksum can be used as a crude test of the correctness of the priority queue though it does not provide any guarantee that it will catch an error. The checksum must be exactly the same for different priority queue implementations, but some errors may go undetected. The basic/ heap can be used as a reference.



Jesper Bojesen
Sat Apr 3 18:07:59 METDST 1999