![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
vampire_3
这个作者很懒,什么都没留下…
展开
-
C++ free
今天偶然在一个方法中碰到一个特殊情况:具体如下介绍:node* sumMe(node* first, node* second){ if(first==NULL||second==NULL) return NULL; node *one = first,*two =second; node *p=NULL,*q=NULL; node *back=NULL,*res=NULL; i原创 2013-07-15 18:02:18 · 885 阅读 · 0 评论 -
字符串逆序
Reverse(int* arr, int b, int e) { for(; b { int temp = arr[e]; arr[e] = arr[b]; arr[b] = temp; } } RightShift(int* arr, int N, int k) { K %= N; Reverse(arr, 0, N – K - 1);原创 2013-07-23 09:17:56 · 552 阅读 · 0 评论 -
快速排序和快速选择
记录,已做参考。1.快速排序:void quickSort(int a[],int first,int end){ int temp = a[end]; int c = first,b = end; if(first<end){ while(first<end){ while(first<end&&a[first]<temp) first++; if(first<原创 2013-07-24 11:59:29 · 548 阅读 · 0 评论 -
亲和数
如果两个数a和b,a的所有真因数之和等于b,b的所有真因数之和等于a,则称a,b是一对亲和数。 例如220和284,1184和1210,2620和2924。 分析: 首先得明确到底是什么是亲和数? 亲和数问题最早是由毕达哥拉斯学派发现和研究的。他们在研究数字的规律的时候发现有以下性质特点的两个数: 220的真因子是:1、2、4、5、10、11、20、22、44、55、110; 28转载 2013-07-31 11:26:44 · 895 阅读 · 0 评论