二茶樹實現通訊錄管理系統

2021-06-07 19:52:32 字數 1902 閱讀 2661

#define n 50

typedef struct student

treedata;

typedef struct treenode

treenode;

#include

#include

#include

extern treenode * mycreatetree();

extern void myinsertnode(treenode *,treedata *);

extern void mycopy(treedata *,char *,char *,char *,char *);

extern void myeva(treedata *);

extern void preorder(treenode *);

extern treenode *treeinit(treenode *);

extern treenode * mysearch(treenode *,char *);

extern int isfind(treenode *,char *);

extern int mycorrect(treenode *,char *);

extern treenode * findleaf(treenode *);

extern treenode * findparent(treenode *,treenode *);

extern void myremove(treenode *,char *);

void mycopy(treedata *dest,char *name,char *studentid,char *brithday,char *tele)

treenode * findleaf(treenode *root)

findleaf(root->leftchild);

findleaf(root->rightchild);

}return leaf;

}treenode *findparent(treenode *root,treenode *leaf)

else

}if(root->rightchild != null)

else

}return parent;

}treenode * mycreatetree()

void myinsertnode(treenode *root,treedata *data)

else

}else

else}}

int isfind(treenode *root,char *info)

treenode * treeinit(treenode *root)

}mycopy(info[0],"張一","202090116","1990-10-11","15298377000");

mycopy(info[1],"張二","202090114","1990-10-12","15298377111");

mycopy(info[2],"張三","202090115","1990-10-13","15298377222");

mycopy(info[3],"張四","202090118","1990-10-14","15298377333");

root = (treenode *)malloc(sizeof(treenode));

root->stuinfo = info[0];

root->leftchild = null;

root->rightchild = null;

myinsertnode(root,info[1]);

myinsertnode(root,info[2]);

myinsertnode(root,info[3]);

return root;

}int main()

通訊錄管理系統

include include include using namespace std const char ptxt e phone.txt const char pctxt e phonecard.txt 將文字位置設為常變數 class phonecard 手機卡類 void set stri...

通訊錄管理系統

在這裡插入 片通訊錄管理系統 include include include 在顯示聯絡人處的性別運用了三目運算子 define max 1000 using namespace std void showmenu 函式定義 返回值型別 函式名 引數列表 例 int add int num1,int...

通訊錄管理系統(C 實現)

系統中需要實現的功能如下 新增聯絡人 向通訊錄中新增新人,資訊包括 姓名 性別 年齡 聯絡 家庭住址 最多記錄1000人 顯示聯絡人 顯示通訊錄中所有聯絡人資訊 刪除聯絡人 按照姓名進行刪除指定聯絡人 查詢聯絡人 按照姓名檢視指定聯絡人資訊 修改聯絡人 按照姓名重新修改指定聯絡人 清空聯絡人 清空通...