
算法
文章平均质量分 65
felix_vip
这个作者很懒,什么都没留下…
展开
-
快速排序非递归算法
#include"stdio.h"#define Maxsize 100void quicksort(int a[],int n){ int i,j,low,high,temp,top=-1; struct node { int low,high; }st[Maxsize]; //栈 top++; st[top].low=0;st[top].high=n-1;//首次入栈 whil转载 2011-03-30 08:52:00 · 542 阅读 · 0 评论 -
#define _INTSIZEOF(n) ((sizeof(n)+sizeof(int)-1)&~(sizeof(int) - 1) ) 的解释
原文地址:http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=814501_INTSIZEOF(n)的宏是实现在不同平台下,关于字节对齐的计算所用。对于两个正整数 x, n 总存在整数 q, r 使得x = nq + r, 其中 0q, r 是唯一确定的。q = [x/n], r = x - n[转载 2012-10-20 18:37:04 · 1048 阅读 · 0 评论