예제 #1
0
        private void CalcCellSize()
        {
            BinaryTree2 tree = new BinaryTree2(Extent, (int)numLevels.Value, 100);

            IEnvelope cell = tree[(long)numLevels.Value];

            numCellSizeX.Value = (decimal)Math.Sqrt(cell.Width * cell.Width + cell.Height * cell.Height);
        }
예제 #2
0
        void displayTree(bool fromZero)
        {
            int times = (int)numericUpDown2.Value;
            int start = fromZero ? 0 : times;

            for (int i = start; i < times + 1; i++)
            {
                string[] tree = BinaryTree2.createBinaryTreeTo(i, "|").Split(new Char[] { ',' });
                String   txt  = "";
                foreach (string branch in tree)
                {
                    txt += branch;
                    txt += Environment.NewLine;
                }
                Output.AppendText(txt);
            }
        }