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

📄 schain.cpp

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

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

SimSpace<int> SimChain<int>::S;

void main(void)
{
   int x;
   SimChain<int> c;
   cout << "Chain length is " << c.Length() << endl;
   c.Insert(0,2).Insert(1,6);
   cout << "Chain length is " << c.Length() << endl;
   c.Find(1,x);
   cout <<"First element is " << x << endl;
   c.Delete(1,x);
   cout << "Deleted " << x << endl;
   cout << "New length is " << c.Length() << endl;
   cout << "Position of 2 is " << c.Search(2) << endl;
   cout << "Position of 6 is " << c.Search(6) << endl;
   c.Insert(0,9).Insert(1,8).Insert(2,7);
   cout << "Current chain is " << c << endl;
   cout << "Its length is " << c.Length() << endl;
}

⌨️ 快捷键说明

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