随笔分类 -  Data Structure

全排列的非递归算法
摘要:1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 5 #define NumOfElem(a) (sizeof(a)/sizeof(a[0])) 6 7 void Swap(int * a, int m, int n) 8 { 9 int temp = a[m];10 a[m] = a[n];11 a[n] = temp;12 }13 14 void Input(int *a, int n)15 {16 int i = 0;17 for (i = 0; i < n;... 阅读全文
posted @ 2011-10-08 22:13 吃吃户 阅读(387) 评论(0) 推荐(0)