Divide And Conquer

Merge Sort: void Merge(int list[], int lowIndex, int highIndex, int midIndex) {    int *tempList = new int[highIndex-lowIndex+1];    int firstLow = lowIndex;    int secondLow = midIndex + 1;    int index = 0;    while(firstLow <= midIndex && secondLow <= highIndex)    {       if (list[firstLow] < list[secondLow])      …

Recursion

递归生成某集合的所有序列: template <class T> void Swap(T& a, T& b) {    T temp = a;    a = b;    b = temp; } template <class T> void Permulation(T list[], int k, int m) {    if (k == m)    {       for (int i = 0; i <= m; i++)  …