public TestBase()
 {
     disp = new BinTreeDisplay();
     disp.Config(
         '-',    // lineChar
         1,      // lineBrsp
         0,      // marginLeft
         2       // floatPre
         );
 }
示例#2
0
        public override void doTask()
        {
            var bst = new BinSearchTree <double, BinNodeConcrete <double> >();

            foreach (var value in new double[] { 100, 50, 70000, 10, 88.523816, 20000, 90000, -123456, 14.78, 62, 500, 30000.19, 40000 })
            {
                bst.Insert(value);
            }

            var disp = new BinTreeDisplay();

            disp.Config(
                '-',    // lineChar
                1,      // lineBrsp
                0,      // marginLeft
                2       // floatPre
                );

            var res = bst.Display(disp);

            Console.WriteLine(res);
            Console.WriteLine();
        }
示例#3
0
        // Adapter method connecting BinTreeDisplay and BinTree
        public List <string> DisplayLstRows(BinTreeDisplay disp)
        {
            var res = disp.GetLstRows <TKey, TNode>(this.Root);

            return(res);
        }
示例#4
0
        // Adapter method connecting BinTreeDisplay and BinTree
        public string Display(BinTreeDisplay disp)
        {
            var res = disp.Get <TKey, TNode>(this.Root);

            return(res);
        }