コード例 #1
0
        public void InsertCase3()
        {
            UnsafeOrderedCollection *t;

            t = Tree(_insertCase3);
            AssertTree(t, "20L=[4=[3L=2|*]|[9=7|11]]|[26=21|30]");
            UnsafeOrderedCollection.Insert(t, 15);
            AssertTree(t, "9=[4L=[3L=2|*]|7]|[20=[11R=*|15]|[26=21|30]]");

            t = Tree(_insertCase3);
            AssertTree(t, "20L=[4=[3L=2|*]|[9=7|11]]|[26=21|30]");
            UnsafeOrderedCollection.Insert(t, 8);
            AssertTree(t, "9=[4=[3L=2|*]|[7R=*|8]]|[20R=11|[26=21|30]]");
        }
コード例 #2
0
 public static bool Contains <T>(UnsafeOrderedSet *set, T item)
     where T : unmanaged, IComparable <T>
 {
     return(UnsafeOrderedCollection.Find <T>(&set->_collection, item) != null);
 }
コード例 #3
0
 public static void Remove <T>(UnsafeOrderedSet *set, T item)
     where T : unmanaged, IComparable <T>
 {
     UnsafeOrderedCollection.Remove <T>(&set->_collection, item);
 }
コード例 #4
0
 public static int Count(UnsafeOrderedSet *set)
 {
     return(UnsafeOrderedCollection.Count(&set->_collection));
 }
コード例 #5
0
 static void AssertTree(UnsafeOrderedCollection *c, string expected)
 {
     NUnit.Framework.Assert.AreEqual(expected, UnsafeOrderedCollection.PrintTree <int>(c, Print));
 }