📄 mytree.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 + -