Пример #1
0
        public void Test_Cases_Naive(int[] nodes, int expected)
        {
            var bst = new BinarySearchTree();

            for (var i = 0; i < nodes.Length; i++)
            {
                bst.insert(nodes[i]);
            }
            var ret = Solution_naive.visibleNodes(bst.root);

            Assert.AreEqual(ret, expected);
        }
Пример #2
0
        public void Test_Random_naive()
        {
            var rand = new Random(DateTime.Now.Millisecond);
            var len  = rand.Next(500, 1000);

            var bst = new BinarySearchTree();

            for (var i = 1; i <= len; i++)
            {
                bst.insert(i);
            }
            var ret = Solution_naive.visibleNodes(bst.root);

            Assert.AreEqual(ret, len);
        }