Tests the PriorityBuffer.
version: $Revision: 307292 $ $Date: 2005-10-08 13:49:53 +0100 (Sat, 08 Oct 2005) $ author: Michael A. Smith author: Steve Phelps
showTree(PriorityBuffer h) Returns a string showing the contents of the heap formatted as a tree.
Makes no attempt at padding levels or handling wrapping.
testRandom() Generate heaps staring with Integers from 0 - heapSize - 1.
Then perform random add / remove operations, checking
heap order after modifications.
Generate heaps staring with Integers from 0 - heapSize - 1.
Then perform random add / remove operations, checking
heap order after modifications. Alternates minHeaps, maxHeaps.
Based on code provided by Steve Phelps in PR #25818
Generates 500 randomly initialized heaps of size 100
and tests that after serializing and restoring them to a byte array
that the following conditions hold:
- the size of the restored heap is the same
as the size of the orignal heap
- all elements in the original heap are present in the restored heap
- the heap order of the restored heap is intact as
verified by checkOrder()