资源简介
这是我们老师自己编的,在vc++6.0上完全可以运行,很不错的

代码片段和文件信息
#include
#include “CircList.h“
using namespace std;
int main(){
CircList list;
ifstream fin(“list.txt“);
assert(fin);
fin >> list;
cout << “The initial list in the file is:\n“ << list << endl;
list.Inverse();
cout << “Inverse the list then the list is:\n“ << list << endl;
cout << “========================================\n“;
int i elem;
cout << “Test the Insert Remove and Search function:\n“;
cout << “Each test will terminate by an invaid input.“;
cout << “\n----------------------------------------\n“;
cout << “1. Test the Insert(int i T &elem):\n“;
while (1){
cout << “Input the index i and data elem to insert: “;
cin >> i >> elem;
if (!cin){//流不正常
cin.clear();//恢复正常
cin.ignore(100‘\n‘);
break;
}
if (i < 0) break;
if (list.Insert(i elem)) cout << “Insert successful!\n“;
else cout << “Insert failed!\n“;
}
cout << “\nAfter inserted\n“ << list << endl;
cout << “----------------------------------------\n“;
cout << “2. Test the Remove(int i T &elem):\n“;
while (1){
cout << “Input the index i in which you want to remove: “;
cin >> i;
if (!cin){
cin.clear();
cin.ignore(100‘\n‘);
break;
}
if (i < 0) break;
if (list.Remove(i elem)) cout << “The element “ << elem << “ has been removed!\n“;
else cout << “Remove failed!\n“;
}
cout << “\nAfter removed\n“ << list << endl;
cout << “----------------------------------------\n“;
cout << “3. Test the Search(T &elem):\n“;
while (1){
cout << “Input the element you want to search: “;
cin >> elem;
if (!cin){
cin.clear();
cin.ignore(100‘\n‘);
break;
}
if (elem < 0) break;
CirclinkNode *p = list.Search(elem);
if (p) cout << “The element “ << elem << “ is in the list.\n“;
else cout << “The element is not exist!\n“;
}
cout << “\n----------------------------------------\n“;
cout << “End test!“ << endl;
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 19900 2009-03-16 08:06 数据结构类库源代码\ch02_LinerList.rar
文件 22169 2009-03-16 08:08 数据结构类库源代码\ch03_Stack_Queue.rar
文件 16680 2009-03-26 20:58 数据结构类库源代码\ch04_Array_String_GenList.rar
文件 31159 2009-04-12 22:58 数据结构类库源代码\ch05_Tree.rar
文件 11396 2009-04-06 15:58 数据结构类库源代码\ch06_Set.rar
文件 45875 2009-05-27 07:32 数据结构类库源代码\ch07_Search.rar
文件 34891 2009-05-06 13:41 数据结构类库源代码\ch08_Graph.rar
文件 24006 2009-05-11 15:02 数据结构类库源代码\ch09_Sort.rar
文件 41 2007-12-29 23:43 数据结构类库源代码\ch09_Sort\WinnerTree\data.txt
文件 713 2009-05-06 18:56 数据结构类库源代码\ch09_Sort\WinnerTree\main.cpp
文件 740 2009-05-06 18:47 数据结构类库源代码\ch09_Sort\WinnerTree\TournamentSort.h
文件 4460 2009-05-06 18:57 数据结构类库源代码\ch09_Sort\WinnerTree\WinnerTree.dsp
文件 545 2009-05-06 18:43 数据结构类库源代码\ch09_Sort\WinnerTree\WinnerTree.dsw
文件 2799 2009-05-06 18:47 数据结构类库源代码\ch09_Sort\WinnerTree\WinnerTree.h
文件 1865 2009-05-08 09:08 数据结构类库源代码\ch09_Sort\Staticli
文件 4463 2009-05-06 18:23 数据结构类库源代码\ch09_Sort\Staticli
文件 557 2009-05-06 18:11 数据结构类库源代码\ch09_Sort\Staticli
文件 4841 2009-05-08 09:07 数据结构类库源代码\ch09_Sort\Staticli
文件 10917 2009-04-29 08:57 数据结构类库源代码\ch09_Sort\MySort\BST.h
文件 2960 2009-05-06 16:41 数据结构类库源代码\ch09_Sort\MySort\dataList.h
文件 3390 2009-05-11 14:53 数据结构类库源代码\ch09_Sort\MySort\main.cpp
文件 4588 2009-05-06 13:58 数据结构类库源代码\ch09_Sort\MySort\MySort.dsp
文件 537 2009-05-06 13:56 数据结构类库源代码\ch09_Sort\MySort\MySort.dsw
文件 9052 2009-05-11 15:00 数据结构类库源代码\ch09_Sort\MySort\MySort.h
文件 3017 2009-05-06 13:55 数据结构类库源代码\ch09_Sort\MySort\person.h
文件 468 2009-05-11 14:58 数据结构类库源代码\ch09_Sort\MySort\persons.txt
文件 1689 2009-03-13 19:35 数据结构类库源代码\ch09_Sort\MySort\SeqStack.h
文件 50176 2010-06-09 16:55 数据结构类库源代码\ch09_Sort\MySort\MySort.ncb
文件 53760 2010-06-09 16:55 数据结构类库源代码\ch09_Sort\MySort\MySort.opt
文件 4428 2009-05-06 13:56 数据结构类库源代码\ch09_Sort\dataList\dataList.dsp
............此处省略262个文件信息
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
评论
共有 条评论