public void InsertSimpleRightRotation() { var t = Tree(3, 2); AssertTree(t, "3L=2|*"); UnsafeOrderedCollection.Insert(t, 1); AssertTree(t, "2=1|3"); UnsafeOrderedCollection.Free(t); }
public void InsertSimpleLeftRightRotation() { var t = Tree(2, 3); AssertTree(t, "2R=*|3"); UnsafeOrderedCollection.Insert(t, 1); AssertTree(t, "2=1|3"); UnsafeOrderedCollection.Free(t); }
public void InsertSimpleLeftRotation() { var t = Tree(1, 2); AssertTree(t, "1R=*|2"); UnsafeOrderedCollection.Insert(t, 3); AssertTree(t, "2=1|3"); UnsafeOrderedCollection.Free(t); }
public void DeleteSimpleLeftRightRotation() { var t = Tree(3, 4, 1, 2); AssertTree(t, "3L=[1R=*|2]|4"); UnsafeOrderedCollection.Remove(t, 4); AssertTree(t, "2=1|3"); UnsafeOrderedCollection.Free(t); }
public void DeleteSimpleRightRotation() { var t = Tree(3, 2, 4, 1); AssertTree(t, "3L=[2L=1|*]|4"); UnsafeOrderedCollection.Remove(t, 4); AssertTree(t, "2=1|3"); UnsafeOrderedCollection.Free(t); }
public void DeleteSimpleRightLeftRotation() { var t = Tree(2, 1, 4, 3); AssertTree(t, "2R=1|[4L=3|*]"); UnsafeOrderedCollection.Remove(t, 1); AssertTree(t, "3=2|4"); UnsafeOrderedCollection.Free(t); }
public void DeleteSimpleLeftRotation() { var t = Tree(2, 1, 3, 4); AssertTree(t, "2R=1|[3R=*|4]"); UnsafeOrderedCollection.Remove(t, 1); AssertTree(t, "3=2|4"); UnsafeOrderedCollection.Free(t); }