public void BinaryTreeMax_test() { var rnd = new Random(); var listOfNums = Enumerable.Range(0, 1000) .Select(x => rnd.Next(-10_000, 10_000)) .ToArray(); var tree = new AVLBinaryTree <int>(); tree.AddRange(listOfNums.ToArray()); var expected = listOfNums.Max(); var actual = tree.Max(); Assert.IsTrue(expected == actual); }
public void BinaryTree_Contains_positive() { var tree = new AVLBinaryTree <int>(); tree.AddRange(new[] { 1, 2, 3, 4, 5, 6, -50, -99 }); var actual = tree.Contains(6); Assert.AreEqual(true, actual); }
public void AddRange_AVLTree() { var tree = new AVLBinaryTree <int>(); tree.AddRange(GetRandomItems()); }