摘要: inthighAve(structtree*root){if(root==NULL)return0;intlefthigh=highAve(root->left);intrighthigh=highAve(root->right);if(abs(lefthigh-righthigh)>=2)retu... 阅读全文
posted @ 2014-10-09 16:34 lycan785 阅读(172) 评论(0) 推荐(0) 编辑
摘要: boolisSub(stringstr0,stringstr1){if(str0.length()!=str1.length())returnfalse;str0=str0.append(str0);if(str0.find(str1)==string::npos)returnfalse;elser... 阅读全文
posted @ 2014-10-09 14:14 lycan785 阅读(141) 评论(0) 推荐(0) 编辑
摘要: char*newstr(char*str){if(str==NULL)returnNULL;intblank=0;intlen=strlen(str);inti=0;for(i=0;i<len;i++)if(str[i]=='')blank++;intj=0;char*newhead=newchar... 阅读全文
posted @ 2014-10-09 13:58 lycan785 阅读(171) 评论(0) 推荐(0) 编辑
摘要: boolcomp(chara,charb){returna>b?true:false;}boolcheck(char*str0,char*str1){if(str0==NULL&&str1==NULL)returntrue;if(str0==NULL||str1==NULL)returnfalse;... 阅读全文
posted @ 2014-10-09 13:25 lycan785 阅读(134) 评论(0) 推荐(0) 编辑
摘要: voidreverse(char*str){if(str==NULL)return;intlen=strlen(str);inti=0;chartmp;for(i=0;i<len/2;i++){tmp=*(str+i);*(str+i)=*(str+len-1-i);*(str+len-1-i)=t... 阅读全文
posted @ 2014-10-09 13:04 lycan785 阅读(114) 评论(0) 推荐(0) 编辑
摘要: boolcheck(char*str){if(str==NULL)returntrue;intlen=strlen(str);if(len==0)returntrue;mapplace;inti=0;for(i=0;i(str[i],true));elsereturnfalse;}returntru... 阅读全文
posted @ 2014-10-09 12:56 lycan785 阅读(93) 评论(0) 推荐(0) 编辑