Esempio n. 1
0
        /// <summary>
        /// Method to create a tree with two children
        /// </summary>
        public static BifiTree GetBifiTree(string _label, BifiTree _left, decimal _leftBranch, BifiTree _right, decimal _rightBranch)
        {
            BifiTree treeReturn = new BifiTree(_label);

            treeReturn.SetLeft(_left, _leftBranch);
            treeReturn.SetRight(_right, _rightBranch);

            return(treeReturn);
        }
Esempio n. 2
0
        /// <summary>
        /// Method to create a tree with one child
        /// </summary>
        public static BifiTree GetBifiTree(string _label, BifiTree _child, decimal _branch, LeftRight _leftRight)
        {
            BifiTree treeReturn = new BifiTree(_label);

            if (_leftRight == LeftRight.Left)
            {
                treeReturn.SetLeft(_child, _branch);
            }
            else
            {
                treeReturn.SetRight(_child, _branch);
            }

            return(treeReturn);
        }