2014年5月21日

不同元素的排列与组合

摘要: #include#include#include#include#includeusing namespace std; vector > ret;vector sub;int num = 0;void helper(int* str, int n,int i) ///递归求组合{ if(i ==... 阅读全文

posted @ 2014-05-21 17:59 berkeleysong 阅读(223) 评论(0) 推荐(0)

两种字符串逆序的方法

摘要: #include#include#include#includeusing namespace std;void helper(char* str) ///用指针实现,注意strlen的用法,并且没有动最后的\0{ int len = strlen(str); int pleft = 0; i... 阅读全文

posted @ 2014-05-21 13:22 berkeleysong 阅读(171) 评论(0) 推荐(0)

递归合并链表~

摘要: #include#includeusing namespace std;class node{public: node():value(0),next(NULL){} ~node(){} int value; node* next;};///be careful this ;... 阅读全文

posted @ 2014-05-21 12:36 berkeleysong 阅读(243) 评论(0) 推荐(0)

使用map做数组与链表去重

摘要: #include#includeusing namespace std;class node{public: node():value(0),next(NULL){} ~node(){} int value; node* next;};///be careful this ;... 阅读全文

posted @ 2014-05-21 10:51 berkeleysong 阅读(501) 评论(0) 推荐(0)

链表有环检测,环长度,环开始的地方

摘要: #includeusing namespace std;class node{public: node():value(0),next(NULL){} ~node(){} int value; node* next;};///be careful this ;node* cr... 阅读全文

posted @ 2014-05-21 09:43 berkeleysong 阅读(197) 评论(0) 推荐(0)

导航