private void buttonInsert_Click(object sender, EventArgs e)
        {
            int left;
            int right;
            int L = textBox1.Lines.Count();

            for (int i = 0; i < L; i++)
            {
                if (textBox1.Lines[i] != "")
                {
                    string[] s = textBox1.Lines[i].Split(',');
                    if (s[1] != ".")
                    {
                        left = Convert.ToInt32(s[1]);
                    }
                    else
                    {
                        left = -1;
                    }
                    if (s[2] != ".")
                    {
                        right = Convert.ToInt32(s[2]);
                    }
                    else
                    {
                        right = -1;
                    }
                    int k = Convert.ToInt32(s[0]);
                    myTree.Insert(ref myTree.top, k, left, right, 200, 40);
                }
            }
            MyDraw();
        }
Beispiel #2
0
        private void buttonInsert_Click(object sender, EventArgs e)
        {
            int L = textBox1.Lines.Count();

            for (int i = 0; i < L; i++)
            {
                if (textBox1.Lines[i] != "")
                {
                    int k = Convert.ToInt32(textBox1.Lines[i]);
                    myTree.Insert(ref myTree.top, k, 200, 40);
                }
            }
            MyDraw();
            textBox3.Text = myTree.SetStrSort(myTree.top);
        }