📄 main.cpp
字号:
#include<iostream>
using namespace std;
#include "staticLinkedList.h"
int main(){
cout<<endl;
cout<<"输入链表:"<<endl;
staticLinkedList<int> lst;
lst.build();
cout<<endl;
cout<<"链表元素:"<<endl;
lst.show();
cout<<endl;
cout<<endl;
insertSort(lst);
cout<<"排序后的链表:"<<endl;
lst.show();
cout<<endl;
cout<<endl;
staticLinkedList<int> lst1;
lst1.build();
cout<<endl;
cout<<"链表元素:"<<endl;
lst1.show();
selectSort(lst1);
cout<<endl;
cout<<"链表元素:"<<endl;
lst1.show();
cout<<endl;
cout<<endl;
staticLinkedList<int> lst2;
lst2.build();
cout<<endl;
cout<<"链表元素:"<<endl;
lst2.show();
rMergeSort(lst2,1,lst2.Length());
cout<<endl;
cout<<"排序后的链表:"<<endl;
lst2.show();
cout<<endl;
cout<<"测试完毕"<<endl;
while(1)//为了在类库说明文档中便于观察,加入这一句
cout<<"";
return 0;
}
/*
输入示例:
输入链表:
输入元素个数:
5
输入元素值:2
输入元素值:3
输入元素值:4
输入元素值:5
输入元素值:6
链表元素:
2 3 4 5 6
排序后的链表:
2 3 4 5 6
输入元素个数:
2
输入元素值:2
输入元素值:5
链表元素:
2 5
The sorted lst is : 2 5
输入元素个数:
6
输入元素值:7
输入元素值:8
输入元素值:
6
输入元素值:3
输入元素值:2
输入元素值:1
链表元素:
7 8 6 3 2 1
排序后的链表:
1 2 3 6 7 8
请按任意键继续. . .
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -