📄 llist.cpp
字号:
// test formula based linear list class
#include <iostream.h>
#include "llist.h"
#include "xcept.h"
void main(void)
{
try
{
LinearList<int> L(5), M(5), N(10), O(10), Y(10), Z(10);;
cout << "Length = " << L.Length() << endl;
cout << "IsEmpty = " << L.IsEmpty() << endl;
L.Insert(0,1).Insert(1,3).Insert(2,5).Insert(3,7);
M.Insert(0,2).Insert(1,4);
cout << "List is " << L << endl;
cout << "IsEmpty = " << L.IsEmpty() << endl;
int z;
L.Find(1,z);
cout << "First element is " << z << endl;
cout << "Length = " << L.Length() << endl;
cout << "Melded list is" << endl;
cout << N.Alternate(L, M) << endl;
cout << "Merged list is" << endl;
cout << O.Merge(L, M) << endl;
O.Split(Y,Z);
cout << "The first split list is" << endl;
cout << Y << endl;
cout << "The second split list is" << endl;
cout << Z << endl;
cout << "After reversal, the list is " << endl;
cout << L.Reverse() << endl;
L.Delete(1,z);
cout << "Deleted element is " << z << endl;
cout << "List is " << L << endl;
}
catch (...)
{
cerr << "An exception has occurred" << endl;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -