public void List() { var pq = new PriorityQueueList <BenchmarkStruct>(maxComparer); foreach (var item in randomItems) { pq.Enqueue(item); } for (int i = 0; i < randomItems.Count; i++) { pq.Dequeue(); } }
public void ListBased() { var sut = new PriorityQueueList <int>(new MaxComparer()); sut.Enqueue(15); sut.Enqueue(14); sut.Enqueue(11); sut.Enqueue(10); sut.Enqueue(12); Assert.Equal(15, sut.Dequeue()); Assert.Equal(14, sut.Dequeue()); Assert.Equal(12, sut.Dequeue()); Assert.Equal(11, sut.Dequeue()); Assert.Equal(10, sut.Dequeue()); }