/// <summary> /// Shows whether the priority queue contains an element. /// </summary> /// <param name="the_check">the element to search for.</param> /// <returns>true if the queue contains the element, otherwise false.</returns> public bool contains(T the_check) { return(my_heap.contains(the_check)); }
private void testContains(BasicHeap <DSInteger> the_heap) { //make sure the correct items are in the queue Assert.AreEqual(true, the_heap.contains(new DSInteger(5))); Assert.AreEqual(true, the_heap.contains(new DSInteger(10))); Assert.AreEqual(true, the_heap.contains(new DSInteger(20))); Assert.AreEqual(true, the_heap.contains(new DSInteger(30))); Assert.AreEqual(true, the_heap.contains(new DSInteger(40))); Assert.AreEqual(true, the_heap.contains(new DSInteger(50))); Assert.AreEqual(true, the_heap.contains(new DSInteger(60))); Assert.AreEqual(true, the_heap.contains(new DSInteger(70))); Assert.AreEqual(true, the_heap.contains(new DSInteger(80))); Assert.AreEqual(true, the_heap.contains(new DSInteger(90))); Assert.AreEqual(true, the_heap.contains(new DSInteger(100))); Assert.AreEqual(true, the_heap.contains(new DSInteger(110))); //make sure no false positives are given Assert.AreEqual(false, the_heap.contains(new DSInteger(120))); }