private void _ctrlBatonRand_Click(object sender, EventArgs e) { int leng = int.Parse(_ctrlTxbNumR.Text); Arr = new int[leng]; Graph.Clear(Color.White); Tree = new HoTSTree(_ctrlPanel.Width, _ctrlPanel.Height); _ctrlNumsVis.Text = ""; for (int i = 0; i < leng; i++) { Arr[i] = _rnd.Next(0, 100); _ctrlNumsVis.Text += Arr[i] + "\r\n"; } for (int i = 0; i < leng; i++) { if (_ctrlNumsVis.Lines[i] != "") { int k = Convert.ToInt32(_ctrlNumsVis.Lines[i]); Tree.Insert(ref Tree.tree_Top, k, 200, 40); } } MyDraw(); }
private void HoTS_Load(object sender, EventArgs e) { Graph = _ctrlPanel.CreateGraphics(); Tree = new HoTSTree(_ctrlPanel.Width, _ctrlPanel.Height); }