Beispiel #1
0
        public void TreeFindMax()
        {
            TreeTraversal <string> t = new TreeTraversal <string>();

            string[]          patterns = new[] { "A", "M", "P", "L", "E" };
            TreeNode <string> max      = t.Max(patterns, 0, patterns.Length - 1);

            Assert.AreEqual("P", max.Item);

            patterns = new[] { "recursive", "program", "that", "builds", "a", "tournament" };
            max      = t.Max(patterns, 0, patterns.Length - 1);

            Assert.AreEqual("tournament", max.Item);
        }