⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 btcontrol.h

📁 一个构建、显示和判断完全二叉树的小程序。
💻 H
字号:
// BTControl.h: interface for the CBTControl class.
//
//////////////////////////////////////////////////////////////////////

#include "BinaryTree.h"
#if !defined(AFX_BTCONTROL_H__8A54C14F_6C19_41D7_930C_24373FD3C9E9__INCLUDED_)
#define AFX_BTCONTROL_H__8A54C14F_6C19_41D7_930C_24373FD3C9E9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//对二叉树进行操作的类

class CBTControl  
{
public:
	//释放树占有的内存空间
	void FreeMemory(CBinaryTree *h);
	//删除节点操作
	bool DeletPoint(CBinaryTree *h,int ip);
	//判断是否为完全二叉树
	bool JudgeBT(CBinaryTree *h);
	//显示二叉树操作
	void ShowBTList(CBinaryTree *h);
	//求孩子操作 (h为头指针,cType为操作类型:f左 t右,Fpoint查找点)
	int CHILD(CBinaryTree *h,bool cType,int Fpoint);
	//插入操作 (h为头指针,InsType为操作类型:f左插入 t右插入,Ipoint插入点)
	bool INS_CHILD(CBinaryTree *h,bool InsType,int Ipoint);
	CBTControl();
	virtual ~CBTControl();

private:
	//计算二叉树层数
	int CountLayer(CBinaryTree *h);
	//插入(fp插入点前继,np插入点后继,Sn若为满二叉树应有的编号)
	bool InsertChild(CBinaryTree *fp,CBinaryTree *np,int Sn);
};

#endif // !defined(AFX_BTCONTROL_H__8A54C14F_6C19_41D7_930C_24373FD3C9E9__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -