shell_mergesorting.cpp
来自「同时对Shell排序和归并排序进行了实现,并且打印了每趟的结果」· C++ 代码 · 共 37 行
CPP
37 行
#include"Shell_MergeSorting.h"
#include<iostream>
//#include<xcept.h>
using namespace std;
void main()
{
mylist<int> a,b;
int size=0;
for(int j=0;j<MAX;j++)
{
int temp;
cin>>temp;
a.insert(size,temp);
b.insert(size,temp);
size++;
}
cout<<"共有"<<a.getlength()<<"个数字"<<endl;
cout<<"谢耳排序结果:"<<endl;
a.ShellSort(a.getlength());
cout<<endl;
cout<<endl;
cout<<"归并排序结果:"<<endl;
b.MergeSort(0,(a.getlength()-1));
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?