llist.cpp

来自「一本全面剖析C++数据结构算法的书籍」· C++ 代码 · 共 28 行

CPP
28
字号
// test formula based linear list class#include <iostream.h>#include "llist.h"#include "xcept.h"void main(void){   try {      LinearList<int> L(5);      cout << "Length = " << L.Length() << endl;      cout << "IsEmpty = " << L.IsEmpty() << endl;      L.Insert(0,2).Insert(1,6);      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;      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 + =
减小字号Ctrl + -
显示快捷键?