public void AsBFS() { BinaryArbor1 <int> tree = GetTestTree(); int[] targetValues = { 2, 1, 3, 4, 5, 6, 7 }; Assert.AreEqual(tree.GetEntireFamily().ToArray().Length, targetValues.Length); AssertCollectionEquality(tree.GetItemsAsBFS(), targetValues); }
public void BFSTest() { BinaryArbor1 <int> tree = GetTestTree(); int[] targetValues = { 2, 1, 3, 4, 5, 6, 7 }; var result = tree.GetItemsAsBFS().ToArray(); Console.WriteLine("Expected: " + ListElements(targetValues)); Console.WriteLine("Actual : " + ListElements(result)); }