冒泡排序--遞歸實現

void bubbleSort(int a[],int n) { int temp; if(n) { bubbleSort(a,n-1);//遞歸最底層是a[0]和a[1]在比較,等同非遞歸內層for循環比較一遍 if(a[n] < a[n-1]) { temp = a[n];
相關文章
相關標籤/搜索