当前位置: 首页>>代码示例>>C#>>正文


C# PriorityQueue.AddAll方法代码示例

本文整理汇总了C#中PriorityQueue.AddAll方法的典型用法代码示例。如果您正苦于以下问题:C# PriorityQueue.AddAll方法的具体用法?C# PriorityQueue.AddAll怎么用?C# PriorityQueue.AddAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PriorityQueue的用法示例。


在下文中一共展示了PriorityQueue.AddAll方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddAllWithCollection

		public void AddAllWithCollection()
		{
			Int32[] empty = new Int32[0];
			Int32[] ints = new Int32[SIZE];
			for (int i = 0; i < SIZE; ++i)
				ints[i] = (SIZE - 1 - i);
			PriorityQueue q = new PriorityQueue(SIZE);
			Assert.IsFalse(q.AddAll(new ArrayList(empty)));
			Assert.IsTrue(q.AddAll(new ArrayList(ints)));
			for (int i = 0; i < SIZE; ++i)
				Assert.AreEqual(i, q.Poll());
		}
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:12,代码来源:PriorityQueueTests.cs

示例2: AddAllWithCollectionWithNullElements

		public void AddAllWithCollectionWithNullElements()
		{
			PriorityQueue q = new PriorityQueue(SIZE);
			object[] ints = new object[SIZE];
			q.AddAll(new ArrayList(ints));
		}
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:6,代码来源:PriorityQueueTests.cs

示例3: AddAllWithCollectionWithSomeNullElements

		public void AddAllWithCollectionWithSomeNullElements()
		{
			PriorityQueue q = new PriorityQueue(SIZE);
			object[] ints = new object[SIZE];
			for (int i = 0; i < SIZE - 1; ++i)
				ints[i] = i;
			q.AddAll(new ArrayList(ints));
		}
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:8,代码来源:PriorityQueueTests.cs

示例4: AddAllWithNullElements

		public void AddAllWithNullElements()
		{
			PriorityQueue q = new PriorityQueue(1);
			q.AddAll(null);
		}
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:5,代码来源:PriorityQueueTests.cs

示例5: ConstructorUsingComparator

		public void ConstructorUsingComparator()
		{
			MyReverseComparator cmp = new MyReverseComparator();
			PriorityQueue q = new PriorityQueue(SIZE, cmp);
			Assert.AreEqual(cmp, q.Comparator());
			Int32[] ints = new Int32[SIZE];
			for (int i = 0; i < SIZE; ++i)
				ints[i] = i;
			q.AddAll(new ArrayList(ints));
			for (int i = SIZE - 1; i >= 0; --i)
				Assert.AreEqual(ints[i], q.Poll());
			Assert.IsTrue( q.IsEmpty );
		}
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:13,代码来源:PriorityQueueTests.cs

示例6: AddAllWithCollectionWithSomeNullElements

		public void AddAllWithCollectionWithSomeNullElements()
		{
			PriorityQueue q = new PriorityQueue(SIZE);
			object[] ints = new object[SIZE];
			for (int i = 0; i < SIZE - 1; ++i)
				ints[i] = i;
            Assert.Throws<ArgumentNullException>(() => q.AddAll(new ArrayList(ints)));
		}
开发者ID:spring-projects,项目名称:spring-net,代码行数:8,代码来源:PriorityQueueTests.cs

示例7: AddAllWithCollectionWithNullElements

		public void AddAllWithCollectionWithNullElements()
		{
			PriorityQueue q = new PriorityQueue(SIZE);
			object[] ints = new object[SIZE];
            Assert.Throws<ArgumentNullException>(() => q.AddAll(new ArrayList(ints)));
		}
开发者ID:spring-projects,项目名称:spring-net,代码行数:6,代码来源:PriorityQueueTests.cs

示例8: AddAllWithNullElements

		public void AddAllWithNullElements()
		{
			PriorityQueue q = new PriorityQueue(1);
            Assert.Throws<ArgumentNullException>(() => q.AddAll(null));
		}
开发者ID:spring-projects,项目名称:spring-net,代码行数:5,代码来源:PriorityQueueTests.cs


注:本文中的PriorityQueue.AddAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。