2012年8月11日

zoj2104(水题一枚)

摘要: 1 #include <stdio.h> 2 #include <algorithm> 3 #include <cstring> 4 using namespace std; 5 6 struct str 7 { 8 char s[30]; 9 int num;10 };11 12 str a[1005];13 14 void init(int k)15 {16 for(int i=0;i<k;i++)17 {18 a[i].num=0;19 }20 }21 22 23 int cmp(str a , str b)24 {25 ... 阅读全文

posted @ 2012-08-11 17:58 矮人狙击手! 阅读(570) 评论(0) 推荐(0) 编辑

poj2255(递归)

摘要: 简单题已知前序遍历,中序遍历,求后序遍历思路,找到根,找到左子树,找到右子树 1 #include <stdio.h> 2 #include <cstring> 3 using namespace std; 4 5 char a[30],b[30]; 6 int count; 7 8 void find(int start, int end) 9 {10 int i;11 if(start>end)12 {13 return;14 }15 char root=a[count++];16 for( i=start;i<=end... 阅读全文

posted @ 2012-08-11 15:28 矮人狙击手! 阅读(255) 评论(0) 推荐(0) 编辑

导航