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

📄 mytree.h

📁 《Visual C++ Bible》或者说是《Visual C++ 宝典》的对应的源码文件
💻 H
字号:
///////////////////////////////////////////////////////////////////////
//
// Mytree.h - Header file defining the classes that actually do the
//				work.
//
// @(#)$Header:$
//
// Description:
//		The classes described herein are based on the Tree classes,
//		but extend them so that we can do actual work.
//
///////////////////////////////////////////////////////////////////////

class Mytree;

class Mynode : public Node
{
	private:
		char *key;
		char *data;
	public:
		Mynode()
			{ key = NULL; data = NULL; };
		Mynode(Mynode & t);
		Mynode(char *inkey, char *indata);
		~Mynode();

		int is_greater(Node *t)
			{ return(strcmp(key, ((Mynode *)t)->key) > 0); };
		int is_equal(Node *t)
			{ return(strcmp(key, ((Mynode *)t)->key) == 0); };
		void print();
		friend Mytree;
};

class Mytree : public Tree
{
	private:
		Mynode *insert(Mynode *mnPtr);
		Mynode *search(Mynode *mnPtr);

	public:
		Mynode *insert(char *key, char *data);
		Mynode *search(char *key);
};

⌨️ 快捷键说明

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