摘要: 防鄙视系列 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 void norecursion_QuickSort(int*,int); 8 int partition(int*,int,int); 9 int main()10 {11 int buf[]={112,332,1,200,123,-1,23214};12 norecursion_QuickSort(buf,sizeof(buf)/4);13 int m;14 return 0;15 }16 17 void norecur... 阅读全文
posted @ 2013-09-10 20:31 cavehubiao 阅读(249) 评论(0) 推荐(0)
摘要: 写个防笔试 1 #include 2 3 struct node 4 { 5 node* pnext; 6 int value; 7 node():pnext(NULL){} 8 }; 9 10 node* ListMerge(node*,node*);11 int main()12 {13 node* head1,*head2;14 head1=new node();15 head1->value=1;16 head1->pnext=new node();17 head1->pnext->value=3;18 head... 阅读全文
posted @ 2013-09-10 18:55 cavehubiao 阅读(314) 评论(0) 推荐(0)
摘要: dpdp始终是让我头疼,开始看着像背包问题,想了会列个状态方程 dp[n]=dp[n]+dp[money[i]];后来一看不对应该是dp[n]=dp[n]+dp[n-money[i]];看来01背包问题还是没搞清楚,后的循环也有问题,我开始的外循环是总钱数,里循环才是硬币种类,应该反过来. 1 /* 2 3 ID: hubiao cave 4 5 PROG: money 6 7 LANG: C++ 8 9 */10 11 12 13 14 #include15 16 #include17 18 #include19 20 using namespace std;21 22 23 24... 阅读全文
posted @ 2013-09-10 13:19 cavehubiao 阅读(228) 评论(0) 推荐(0)