예제 #1
0
        public void One()
        {
            QueueByLinkedList <int> sa = new QueueByLinkedList <int>();

            sa.Enqueue(1);
            Assert.Equal(1, sa.Dequeue());
            Assert.True(sa.IsEmpty);
        }
예제 #2
0
        public void Bulk()
        {
            QueueByLinkedList <int> sa = new QueueByLinkedList <int>();

            for (int i = 0; i < 2000000; i++)
            {
                sa.Enqueue(i);
            }

            for (int i = 0; i < 2000000; i++)
            {
                Assert.Equal(i, sa.Dequeue());
            }
        }
예제 #3
0
        public void TwoTwo()
        {
            QueueByLinkedList <int> sa = new QueueByLinkedList <int>();

            sa.Enqueue(1);
            sa.Enqueue(2);
            Assert.Equal(1, sa.Dequeue());
            Assert.False(sa.IsEmpty);
            Assert.Equal(2, sa.Dequeue());
            Assert.True(sa.IsEmpty);

            sa.Enqueue(3);
            sa.Enqueue(4);
            Assert.Equal(3, sa.Dequeue());
            Assert.False(sa.IsEmpty);
            Assert.Equal(4, sa.Dequeue());
            Assert.True(sa.IsEmpty);
        }
예제 #4
0
        public void None()
        {
            QueueByLinkedList <int> sa = new QueueByLinkedList <int>();

            Assert.True(sa.IsEmpty);
        }