Пример #1
0
        public void FindModeTest3()
        {
            ModeInBinaryTree modeInBinaryTree = new ModeInBinaryTree();

            TreeNode node = new TreeNode(2147483647);

            int[] res = modeInBinaryTree.FindMode2(node);
            Assert.IsTrue(res[0] == 2147483647);
        }
Пример #2
0
        public void FindModeTest()
        {
            ModeInBinaryTree modeInBinaryTree = new ModeInBinaryTree();
            TreeNode         node2l           = new TreeNode(2);
            TreeNode         node1r           = new TreeNode(2, node2l, null);
            TreeNode         node             = new TreeNode(1, null, node1r);

            int[] res = modeInBinaryTree.FindMode2(node);
            Assert.IsTrue(res[0] == 2);
        }