public void RandomDuplicates()
{
int length = 1000;
int s;
int[] a = new int[length];
Random ran = new Random(6754);
for (int i = 0; i < length; i++)
queue.Add(a[i] = ran.Next(3, 13));
Assert.IsTrue(queue.Check());
Array.Sort(a);
for (int i = 0; i < length / 2; i++)
{
Assert.AreEqual(a[i], queue.DeleteMin());
Assert.IsTrue(queue.Check());
Assert.AreEqual(a[length - i - 1], s = queue.DeleteMax());
Assert.IsTrue(queue.Check());
}
Assert.IsTrue(queue.IsEmpty);
}