摘要:
#include #include typedef struct node{ int id; struct node *left; struct node *right;} node; node *find(int id, node *root){ if (root == NULL) return (NULL); if (id id) return (find(id, root->left)); else if (id > root->id) return (find(id, root->right)); else ... 阅读全文
摘要:
#include #include #define max(x, y) (((x) > (y)) ? (x) : (y))typedef struct node{ int id; int h; // height struct node *left; struct node *right;} node;static node *findmin(node *root){ if (root == NULL) return (NULL); if (root->left == NULL) return (root); ... 阅读全文