Exemplo n.º 1
0
        public void BinaryTree_Preorder_test()
        {
            var tree = new RedBlackBinaryTree <int>(6,
                                                    55,
                                                    -55,
                                                    -40,
                                                    8,
                                                    66,
                                                    554,
                                                    74,
                                                    12,
                                                    7);

            var ordered = new[]
            {
                6,
                -55,
                -40,
                55,
                8,
                7,
                12,
                74,
                66,
                554
            };

            var preorder = tree.Preorder()
                           .ToArray();

            CollectionAssert.AreEqual(ordered, preorder);
        }
Exemplo n.º 2
0
 public void RedBlackBinaryTreePreorder() => _redBlack.Preorder();