随笔分类 -  binary tree

摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 int result[128]; 6 int ans[200]; 7 int count=1; 8 int main() 9 {10 int n;11 while(cin>>n)12 {13 if(n==0)14 break;15 getchar();16 string str;17 getline(cin,str);18 int i;19 ... 阅读全文
posted @ 2013-03-31 00:07 sooflow 阅读(131) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 struct node{ 6 int black; 7 node* first; 8 node* second; 9 node* third;10 node* forth;11 };12 int cur;13 string str;14 int flag[1024];15 void lable(int begin,int end)16 {17 for(int i=begin;iblack=0;27 p->first... 阅读全文
posted @ 2013-03-31 00:05 sooflow 阅读(128) 评论(0) 推荐(0)
摘要:1 #include 2 using namespace std; 3 int sum; 4 int ok; 5 struct node{ 6 int value; 7 node* lchild; 8 node* rchild; 9 };10 node* creat()11 {12 char ch;13 cin>>ch;14 int value;15 if(cin>>value)16 {17 node* p=new node;18 p->value=value;19 p->lchi... 阅读全文
posted @ 2013-03-31 00:04 sooflow 阅读(122) 评论(0) 推荐(0)