Пример #1
0
 public void testIntArray()
 {
     DynamicIntArray dia = new DynamicIntArray(10);
     for (int i = 0; i < 10000; ++i)
     {
         dia.add(2 * i);
     }
     Assert.Equal(10000, dia.size());
     for (int i = 0; i < 10000; ++i)
     {
         Assert.Equal(2 * i, dia.get(i));
     }
     dia.clear();
     Assert.Equal(0, dia.size());
     dia.add(3);
     dia.add(12);
     dia.add(65);
     Assert.Equal("{3,12,65}", dia.ToString());
     for (int i = 0; i < 5; ++i)
     {
         dia.increment(i, 3);
     }
     Assert.Equal("{6,15,68,3,3}", dia.ToString());
 }
Пример #2
0
 public StringRedBlackTree(int initialCapacity)
     : base(initialCapacity)
 {
     keyOffsets = new DynamicIntArray(initialCapacity);
 }