⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sochain.cpp

📁 data structures, algorithms and Application书的源代码
💻 CPP
字号:
// test sorted chain class

#include <iostream.h>
#include "sochain.h"

void main(void)
{
   SortedChain<int, int> Z;
   int x;
   Z.Insert(2).Insert(6).Insert(4);
   cout << "The chain is " << Z << endl;
   cout << "Its length is " << Z.Length() << endl;
   Z.Delete(2,x);
   cout << "Deleted " << x << endl;
   cout << Z << endl;
   Z.Insert(1).Delete(6,x);
   cout << Z << endl;
   Z.Insert(8).Insert(9).Search(8,x);
   cout << "Found " << x << endl;
   Z.Insert(7).Delete(9,x);
   cout << Z << endl;
   try {Z.DistinctInsert(7);}
   catch (BadInput)
      {cout << "Attempt to insert duplicate element" << endl;}
   cout << Z << endl;
   Z.DistinctInsert(10);
   cout << Z << endl;
}

⌨️ 快捷键说明

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