͸

来自「排序算法的内部复杂度分析,有八个算法,有时间和空间的分析,比较完整」· 代码 · 共 55 行

TXT
55
字号
int record[6][2];              //global variable
int copy[100];
int array[100];
int bubblerecord=0;            //global variable
int selectrecord=0;            //global variable
int insertrecord=0;            //global variable
int shellrecord	=0;            //global variable
int quicksortrecord=0;         //global variable
int heapsortrecord=0;		   //global variable
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

#include"copyright.cpp"
#include"password.cpp"
#include"initiarray.cpp"
#include"menu.cpp"
#include"statistics.cpp"


void main()
{int i,*p,flag=1;
char ch;
copyright(); 
password();
puts("\nLoading...\n");
p=initiarray();
puts("100 numbers have been generated by the function--rand().\nwould you like to show them? Y/N\n");
while(flag)
{
	ch=getchar();
	getchar();
    if(ch=='y'||ch=='Y')
	{
		for(i=0;i<100;i++)
        printf("%d\t",*(p+i));
		printf("\n");
	}
	flag=0;
}
puts("\nNext step is to sort the numbers with 6 methods of algorthm.\nwould you like to turn to the selection-menu?\nY/N ?");
flag=1;
while(flag)
{
	ch=getchar();
	getchar();
	if(ch=='y'||ch=='Y')
	{
		menu();
        statistics();
	}

	flag=0;
}
}

⌨️ 快捷键说明

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