📄 form1.h
字号:
#pragma once
namespace DSchen {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
#define MaxNode 50
public struct BiTree{
Char data;
int no;
int x,y;
int layer;
BiTree *Lchild,*Rchild;
BiTree *parent;
};
public struct Edge{
int node,node2;//顶点位置
Edge *nextedge;
};
public struct Node{
Char data;
int degree;
bool Mark;
int x,y;
Edge *firstedge;
Edge *lastedge;
};
public struct Graph{
Node node[MaxNode];
int nodenum,edgenum;
};
/// <summary>
/// Form1 摘要
///
/// 警告: 如果更改此类的名称,则需要更改
/// 与此类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。否则,
/// 设计器将不能与此窗体的关联
/// 本地化资源正确交互。
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: 在此处添加构造函数代码
//
}
protected:
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::MenuStrip^ menuStrip1;
protected:
Graphics ^ g;
BiTree *root;
Graph *graph;
private: System::Windows::Forms::ToolStripMenuItem^ 树ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 二叉树建立ToolStripMenuItem;
private: System::Windows::Forms::PictureBox^ pictureBox1;
private: System::Windows::Forms::GroupBox^ groupBoxTree;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ buttonCreatTree;
private: System::Windows::Forms::TextBox^ textBoxBiTree;
private: System::Windows::Forms::ToolStripMenuItem^ 二叉树遍历ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 先序遍历ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 退出ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 中序遍历ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 后序遍历ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ tuToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 图的建立ToolStripMenuItem;
private: System::Windows::Forms::GroupBox^ groupBoxGraph;
private: System::Windows::Forms::TextBox^ textBoxGraph;
private: System::Windows::Forms::Button^ buttonGraphCreate;
private: System::Windows::Forms::ToolStripMenuItem^ 刷新ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 深度优先遍历ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 深度优先ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 广度优先ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 源码查看ToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ 图广度优先ToolStripMenuItem;
private: System::Windows::Forms::RichTextBox^ richTextBoxBFS;
private: System::Windows::Forms::ToolStripMenuItem^ 关闭源码ToolStripMenuItem;
private: System::Windows::Forms::RichTextBox^ richTextBoxDFS;
private: System::Windows::Forms::ToolStripMenuItem^ 图深度优先ToolStripMenuItem;
private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->树ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->二叉树建立ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->二叉树遍历ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->先序遍历ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->中序遍历ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->后序遍历ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->tuToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->图的建立ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->刷新ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->深度优先遍历ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->深度优先ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->广度优先ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->源码查看ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->图广度优先ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->关闭源码ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->图深度优先ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->退出ToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
this->groupBoxTree = (gcnew System::Windows::Forms::GroupBox());
this->button2 = (gcnew System::Windows::Forms::Button());
this->buttonCreatTree = (gcnew System::Windows::Forms::Button());
this->textBoxBiTree = (gcnew System::Windows::Forms::TextBox());
this->groupBoxGraph = (gcnew System::Windows::Forms::GroupBox());
this->buttonGraphCreate = (gcnew System::Windows::Forms::Button());
this->textBoxGraph = (gcnew System::Windows::Forms::TextBox());
this->richTextBoxBFS = (gcnew System::Windows::Forms::RichTextBox());
this->richTextBoxDFS = (gcnew System::Windows::Forms::RichTextBox());
this->menuStrip1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->BeginInit();
this->groupBoxTree->SuspendLayout();
this->groupBoxGraph->SuspendLayout();
this->SuspendLayout();
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) {this->树ToolStripMenuItem,
this->tuToolStripMenuItem, this->源码查看ToolStripMenuItem, this->退出ToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Padding = System::Windows::Forms::Padding(8, 2, 0, 2);
this->menuStrip1->Size = System::Drawing::Size(1099, 24);
this->menuStrip1->TabIndex = 0;
this->menuStrip1->Text = L"menuStrip1";
//
// 树ToolStripMenuItem
//
this->树ToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->二叉树建立ToolStripMenuItem,
this->二叉树遍历ToolStripMenuItem});
this->树ToolStripMenuItem->Name = L"树ToolStripMenuItem";
this->树ToolStripMenuItem->Size = System::Drawing::Size(34, 20);
this->树ToolStripMenuItem->Text = L"树";
//
// 二叉树建立ToolStripMenuItem
//
this->二叉树建立ToolStripMenuItem->Name = L"二叉树建立ToolStripMenuItem";
this->二叉树建立ToolStripMenuItem->Size = System::Drawing::Size(149, 22);
this->二叉树建立ToolStripMenuItem->Text = L"二叉树建立";
this->二叉树建立ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::二叉树建立ToolStripMenuItem_Click);
//
// 二叉树遍历ToolStripMenuItem
//
this->二叉树遍历ToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->先序遍历ToolStripMenuItem,
this->中序遍历ToolStripMenuItem, this->后序遍历ToolStripMenuItem});
this->二叉树遍历ToolStripMenuItem->Name = L"二叉树遍历ToolStripMenuItem";
this->二叉树遍历ToolStripMenuItem->Size = System::Drawing::Size(149, 22);
this->二叉树遍历ToolStripMenuItem->Text = L"二叉树遍历";
//
// 先序遍历ToolStripMenuItem
//
this->先序遍历ToolStripMenuItem->Name = L"先序遍历ToolStripMenuItem";
this->先序遍历ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->先序遍历ToolStripMenuItem->Text = L"先序遍历";
this->先序遍历ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::先序遍历ToolStripMenuItem_Click);
//
// 中序遍历ToolStripMenuItem
//
this->中序遍历ToolStripMenuItem->Name = L"中序遍历ToolStripMenuItem";
this->中序遍历ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->中序遍历ToolStripMenuItem->Text = L"中序遍历";
this->中序遍历ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::中序遍历ToolStripMenuItem_Click);
//
// 后序遍历ToolStripMenuItem
//
this->后序遍历ToolStripMenuItem->Name = L"后序遍历ToolStripMenuItem";
this->后序遍历ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->后序遍历ToolStripMenuItem->Text = L"后序遍历";
this->后序遍历ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::后序遍历ToolStripMenuItem_Click);
//
// tuToolStripMenuItem
//
this->tuToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->图的建立ToolStripMenuItem,
this->刷新ToolStripMenuItem, this->深度优先遍历ToolStripMenuItem});
this->tuToolStripMenuItem->Name = L"tuToolStripMenuItem";
this->tuToolStripMenuItem->Size = System::Drawing::Size(34, 20);
this->tuToolStripMenuItem->Text = L"图";
//
// 图的建立ToolStripMenuItem
//
this->图的建立ToolStripMenuItem->Name = L"图的建立ToolStripMenuItem";
this->图的建立ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->图的建立ToolStripMenuItem->Text = L"图的建立";
this->图的建立ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::图的建立ToolStripMenuItem_Click);
//
// 刷新ToolStripMenuItem
//
this->刷新ToolStripMenuItem->Name = L"刷新ToolStripMenuItem";
this->刷新ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->刷新ToolStripMenuItem->Text = L"刷新";
this->刷新ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::刷新ToolStripMenuItem_Click);
//
// 深度优先遍历ToolStripMenuItem
//
this->深度优先遍历ToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->深度优先ToolStripMenuItem,
this->广度优先ToolStripMenuItem});
this->深度优先遍历ToolStripMenuItem->Name = L"深度优先遍历ToolStripMenuItem";
this->深度优先遍历ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->深度优先遍历ToolStripMenuItem->Text = L"遍历";
//
// 深度优先ToolStripMenuItem
//
this->深度优先ToolStripMenuItem->Name = L"深度优先ToolStripMenuItem";
this->深度优先ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->深度优先ToolStripMenuItem->Text = L"深度优先";
this->深度优先ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::深度优先ToolStripMenuItem_Click);
//
// 广度优先ToolStripMenuItem
//
this->广度优先ToolStripMenuItem->Name = L"广度优先ToolStripMenuItem";
this->广度优先ToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->广度优先ToolStripMenuItem->Text = L"广度优先";
this->广度优先ToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::广度优先ToolStripMenuItem_Click);
//
// 源码查看ToolStripMenuItem
//
this->源码查看ToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->图广度优先ToolStripMenuItem,
this->图深度优先ToolStripMenuItem, this->关闭源码ToolStripMenuItem});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -