⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 misc.c

📁 A order algoritm comparison by the C time(). Comparison beetwen : insort,selection sort,mergesort,
💻 C
字号:
#include "in.h"#include "func.h"/*------------------------------------------------------------------- * Function:   readArray * Purpose:    read in the contents of the array A * Input arg:  n, the number of elements to be read * Output arg: A, the array */void readArray(int A[], int n) {   int i;   for (i = 0; i < n; i++)   {   fprintf (stderr,"[@] Please insert the element %d of array [@] :",i);   fscanf(stdin,"%d", &A[i]);   }}  /* readArray *//*------------------------------------------------------------------- * Function:   printArray * Purpose:    print the contents of the array A * Input args:   *    n, the number of elements to be read *    A, the array */void printArray(int A[], int n) {   int i;   for (i = 0; i < n; i++)    printf("[%d] ", A[i]);   printf("\n");}  /* printArray *//*------------------------------------------------------------------- * Function:   randArray * Purpose:    empty an array A[length_array] with random elements  *	       if randomize is set to 1 else the random numbers are  *	       always the same. * Input args: *    lenght_array the length of array *    A, 	   the array *    range_random is the range of casual nubers *    randomize    the alg var */void randArray(int A[],int range_random,int length_array,int randomize){ int i=0; if(randomize==1)  update_seed(); else seed=10000; for (i;i<length_array ;i++) A[i]=l_int_rand(range_random);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -