摘要:
冒泡排序:void bublle_sort(int s[], int n){ int i, j, temp; for (i = 0; i = 0 && s[j] > temp; j--) { s[j+1] = s[j]; } s[j+1] = temp; }}选择排序:void select_sort(int s[], int n){ int i,j,min,temp; for (i = 0; i i && s[j] >= temp) j--; s[i] = s[... 阅读全文
摘要:
二分查找的代码int bfind(int* a,int len, int val){ int le = 0,re = len - 1,m; while (leval) re = m - 1; else le = m + 1; } return -1; //}写出在母串中查找子串出现次数int count1(char* str,char* s){ char* s1; char* s2; int count = 0; while(*str!='\0') { s1 =... 阅读全文