2011年4月16日

二叉搜索树 链表

摘要: 有指针一定要小心中,今天一不小心,浪费了我一个小时去改错。。悲剧。。。注意指针初始化。。。还有全局变量,局部变量。。指针与取地址。。#include<stdio.h>#include<string.h>//#include<debug.h>#include<stdlib.h>typedef struct node{ struct node *rchild,*lchild; int ch;}NODE,*NOE;void creattree(NOE &T,NOE P){ NOE S,Q; if(P==NULL) return ; //prin 阅读全文

posted @ 2011-04-16 11:33 more think, more gains 阅读(166) 评论(0) 推荐(0) 编辑

hdu 3791 二叉搜索树

摘要: 这题好纠结啊。。字符数组后面没加‘\0'错了好多次。。。。。但是我搜了下别人代码。。没加'\0'就能AC啊。。不明白。。。。#include<stdio.h>#include<string.h>#include<stdlib.h>#include<debug.h>#define M 2001char A[M],B[M];char str[11];void Creattree(char *C,char key,const int top ){ if(C[top]=='*') { C[top]=key; } e 阅读全文

posted @ 2011-04-16 09:41 more think, more gains 阅读(217) 评论(0) 推荐(0) 编辑

导航