- 博客(2)
- 收藏
- 关注
原创 递归法排序
#include "stdio.h"#define MAX 100void qsort(int v[],int left,int right); main(){ int i,j,a[MAX]; j=10; for(i=0;i a[i]=j--; for(i=0;i printf("%d ",a[i]); qsort(a,0,9); for(i=0;i printf("%d ",a[i]
2009-04-12 00:11:00
438
原创 x &= (x-1)
最近在《the c programing language》看到这一个算法,一开始不太明白,仔细的分析了一下还是蛮高明的,上网搜索了一下,好些网友对此不是很了解,写在这里大家一起分享一下:If x is odd, then (x-1) has the same bit representation as x except that the rightmost 1-bit is now a 0.
2009-03-24 20:39:00
434
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人