亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

蟲蟲首頁| 資源下載| 資源專輯| 精品軟件
登錄| 注冊

integers

  • In number theory, the Euclidean algorithm (also called Euclid s algorithm) is an algorithm to determ

    In number theory, the Euclidean algorithm (also called Euclid s algorithm) is an algorithm to determine the greatest common divisor (GCD) of two elements of any Euclidean domain (for example, the integers). Its major significance is that it does not require factoring the two integers, and it is also significant in that it is one of the oldest algorithms known, dating back to the ancient Greeks.

    標簽: algorithm Euclidean Euclid number

    上傳時間: 2017-07-17

    上傳用戶:戀天使569

  • C語言算法排序問題

    1.Describe a Θ(n lg n)-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x. (Implement exercise 2.3-7.)

    標簽: 算法 排序

    上傳時間: 2017-04-01

    上傳用戶:糖兒水嘻嘻

  • c語言算法排序

    1.Describe a Θ(n lg n)-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x. (Implement exercise 2.3-7.) #include<stdio.h> #include<stdlib.h> void merge(int arr[],int low,int mid,int high){      int i,k;      int *tmp=(int*)malloc((high-low+1)*sizeof(int));      int left_low=low;      int left_high=mid;      int right_low=mid+1;      int right_high=high;      for(k=0;left_low<=left_high&&right_low<=right_high;k++)      {      if(arr[left_low]<=arr[right_low]){                                        tmp[k]=arr[left_low++];                                        }      else{           tmp[k]=arr[right_low++];           } }             if(left_low<=left_high){                              for(i=left_low;i<=left_high;i++){                                                               tmp[k++]=arr[i];                                                               }                              }       if(right_low<=right_high){                              for(i=right_low;i<=right_high;i++)                                                                tmp[k++]=arr[i];                                                        }                              for(i=0;i<high-low+1;i++)                                                       arr[low+i]=tmp[i];       } void merge_sort(int a[],int p,int r){      int q;      if(p<r){              q=(p+r)/2;              merge_sort(a,p,q);              merge_sort(a,q+1,r);              merge(a,p,q,r);              }      } int main(){     int a[8]={3,5,8,6,4,1,1};     int i,j;     int x=10;     merge_sort(a,0,6);     printf("after Merging-Sort:\n");     for(i=0;i<7;i++){                      printf("%d",a[i]);                      }     printf("\n");     i=0;j=6;     do{                                    if(a[i]+a[j]==x){                                  printf("exist");                                  break;                                  }                  if(a[i]+a[j]>x)                                 j--;                  if(a[i]+a[j]<x)                                 i++;                       }while(i<=j);     if(i>j)              printf("not exist");     system("pause");     return 0;     }

    標簽: c語言 算法 排序

    上傳時間: 2017-04-01

    上傳用戶:糖兒水嘻嘻

主站蜘蛛池模板: 巫溪县| 怀安县| 永康市| 张家港市| 鹤庆县| 灵丘县| 巴南区| 云霄县| 雷波县| 汤原县| 巍山| 友谊县| 福清市| 林口县| 方城县| 邵东县| 堆龙德庆县| 锡林郭勒盟| 长宁县| 吕梁市| 从江县| 自贡市| 新泰市| 景泰县| 济宁市| 六盘水市| 中牟县| 屯昌县| 若尔盖县| 尼木县| 井研县| 大新县| 云霄县| 英吉沙县| 台山市| 固镇县| 宣恩县| 濉溪县| 邛崃市| 凤山县| 五家渠市|