예제 #1
0
        public void TestClear()
        {
            var queue = new TreeQueue <int>(branchingFactor: 3);

            queue.Clear();
            Assert.Empty(queue);

            foreach (int item in Enumerable.Range(0, 10))
            {
                queue.Enqueue(item);
            }

            Assert.NotEmpty(queue);
            queue.Clear();
            Assert.Empty(queue);
        }
예제 #2
0
 public void Reset()
 {
     TreeQueue.Clear();
     CurrentRoseTree = null;
     TreeQueue.Push(new Lazy <RoseTree <T> >(() => OriginalTree));
 }