public void SortedSet()
        {
            var pq = new PriorityQueueSortedSet <BenchmarkStruct>(maxComparer);

            foreach (var item in randomItems)
            {
                pq.Enqueue(item);
            }

            for (int i = 0; i < randomItems.Count; i++)
            {
                pq.Dequeue();
            }
        }
示例#2
0
        public void SortedSetBased()
        {
            var sut = new PriorityQueueSortedSet <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());
        }