摘要:
1 # include 2 # include 3 using namespace std; 4 int inorder(int i,int j) 5 { 6 if(i<=j) 7 printf("%d ",i); 8 if(2*i<=j) 9 inorder(2*i,j);10 if(2*i+1<=j)11 inorder(2*i+1,j);12 return 1;13 }14 int main()15 {16 inorder(1,5);17 }View Code 阅读全文
posted @ 2013-12-10 17:38
天天AC
阅读(222)
评论(0)
推荐(0)
摘要:
非递归算法对完全二叉树的前序遍历代码 1 # include 2 # include 3 using namespace std; 4 const int m = 100; 5 struct b 6 { 7 char data; 8 int num; 9 }se[m];10 int main()11 {12 stacks;13 int n;14 cin>>n;15 for(int i = 0;i >se[i].data;18 }19 se[0].num = 0;20 int root = se[0].num;21 ... 阅读全文
posted @ 2013-12-10 17:28
天天AC
阅读(297)
评论(0)
推荐(0)