public void ListToTree(int[] values) { ImmutableAVL tree = new ImmutableAVL(values); Assert.AreEqual(values.Length, tree.Count()); Assert.IsTrue(isAVLTreeValid(tree)); }
public void Peek(int[] values) { ImmutableAVL tree = new ImmutableAVL(values); int peek = tree.Peek(); Assert.AreEqual(peek, values.Min()); Assert.AreEqual(values.Length, tree.Count()); }
public void Insert(int[] values) { ImmutableAVL tree = new ImmutableAVL(values); tree.Add(5); Assert.AreEqual(values.Length + 1, tree.Count()); Assert.IsTrue(isAVLTreeValid(tree)); }
public void Pop(int[] values) { ImmutableAVL tree = new ImmutableAVL(values); int pop = tree.Pop(); Assert.AreEqual(pop, values.Min()); Assert.AreEqual(values.Length - 1, tree.Count()); Assert.IsTrue(isAVLTreeValid(tree)); }