摘要: #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 ... 阅读全文
posted @ 2013-09-25 16:53 玩的就是 心跳 阅读(230) 评论(0) 推荐(0) 编辑
摘要: #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); ... 阅读全文
posted @ 2013-09-25 16:47 玩的就是 心跳 阅读(95) 评论(0) 推荐(0) 编辑