form1.cs
来自「数据结构排序部分的二叉树排序」· CS 代码 · 共 50 行
CS
50 行
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace binarytreesort
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public binarysorttree bst;
private void button1_Click(object sender, EventArgs e)
{
int[] Data = new int[10] { 1, 5, 3, 8,50 ,5,9,7,3,10};
bst = new binarysorttree(Data);
ArrayList Array = new ArrayList();
binarysorttreenode boot = new binarysorttreenode();
boot = bst.ROOT;
bst.inordertraverse(ref boot , ref Array);
int i = 0;
while (i < Array.Count)
{
richTextBox1.AppendText(Array[i].ToString()+"\n");
i++;
}
}
private void button2_Click(object sender, EventArgs e)
{
richTextBox2.Clear();
ArrayList Array = new ArrayList();
binarysorttreenode boot = new binarysorttreenode();
boot = bst.ROOT;
bst.delete(ref boot, Convert .ToInt16 (this.textBox1.Text.ToString()));
bst.inordertraverse(ref boot, ref Array);
int i = 0;
while (i < Array.Count)
{
richTextBox2.AppendText(Array[i].ToString() + "\n");
i++;
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?