lxbst.h

来自「vc编写的数据结构」· C头文件 代码 · 共 50 行

H
50
字号
// lxbst.h: interface for the lxbst class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LXBST_H__3C60B776_A398_49C2_9C4C_0D5B7112B01D__INCLUDED_)
#define AFX_LXBST_H__3C60B776_A398_49C2_9C4C_0D5B7112B01D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "lxbinnode.h"
#include "lxlqueue.h"

class lxbst  
{
public:
	void count();
	void printonline();
	int higth();
	void bacorderprint();
	void midorderprint();
	void preorderprint();
	void print()const;
	int size();
	bool find(const int&,int&);
	bool removeany(int&);
	bool remove(const int&,int&);
	bool insert(const int&);
	void clear();
	lxbst();
	virtual ~lxbst();

private:
	int counthelp(lxbinnode*);
	int higthhelp(lxbinnode*);
	void bacorder(lxbinnode*);
	void midorder(lxbinnode*);
	void preorder(lxbinnode *);
	void printhelp(lxbinnode*,int)const;
	bool findhelp(lxbinnode*,const int&,int&);
	lxbinnode* removehelp(lxbinnode*,const int&,lxbinnode*&);
	lxbinnode* deletemin(lxbinnode*,lxbinnode*&);
	lxbinnode* inserthelp(lxbinnode*,const int&);
	void clearhelp(lxbinnode*);
	int nodecount;
	lxbinnode* root;
};

#endif // !defined(AFX_LXBST_H__3C60B776_A398_49C2_9C4C_0D5B7112B01D__INCLUDED_)

⌨️ 快捷键说明

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