1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
大蒟蒻 920a583abc
Wed, 11 Mar 2020 19:37:48 +0800
6 years ago
..
.vscode Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
Benchmark.cpp Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
Benchmark.h Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
CMakeLists.txt Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
DataTypeProxy.h Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
LinearList.h Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
OrderListTest.cpp Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
PerfCounter.h Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
SeqList.h Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
Utilities.h Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
benchmark_hw2_1.txt Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
readme.txt Wed, 11 Mar 2020 19:37:48 +0800 6 years ago
readme2.txt Wed, 11 Mar 2020 19:37:48 +0800 6 years ago

readme.txt

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

数据结构 作业2

目标:本次作业练习顺序表的应用——实现有序顺序表。


开始:
1解压hw2.rar得到hw2文件夹。
在hw2文件夹中LinearList.h头文件实现顺序表基类数据结构。
SeqList.h头文件实现顺序表数据结构SeqList类
OrderListTest.cpp源文件实现对有序顺序表的测试。

2建立一个空项目添加LinearList.h、SeqList.h、OrderListTest.cpp到项目中。

3OrderListTest.cpp文件中包含main函数实现测试有序顺序表的代码。
测试用例在空线性表myLista中依次“有序插入”数据元素6,5,3,8,2,7,1,9,4,1后建立有序顺序表myLista=<1,1,2,3,4,5,6,7,8,9>并输出顺序表;然后删除数据元素1;其次依次显示当前线性表中所有数据元素。然后采用类似以上的步骤建立有序顺序表myListb=<7,8,2,7,6,8,2,6,9,10,1,3,4,11,35>。最后将两个有序顺序表myLista和myListb合并到一个有序顺序表myListc中。

4你的第一个任务
在SeqList.h中编写OrderInsert()函数。OrderInsert()函数实现在有序顺序表中按数据元素非递减的顺序插入一个数据元素item使得L中的数据元素按值非递减有序序列。

5你的第二个任务
在OrderListTest.cpp文件中把有序顺序表myLista和myListb合并到有序顺序表myListc中并输出myListc。

6你的第三个任务选做
在SeqList.h中编写MoreRemoveT &x函数。顺序表中可能有重复的x值。MoreRemoveT &x函数实现在有序顺序表中删除所有值为x的元素。尽可能算法高效考虑减少元素移动的次数。

7)编写你自己的readme.txt文件按照结构体程序设计方法或面向对象程序设计方法 展示你的算法以及设计过程,分析算法的时间复杂度和空间复杂度。
8)压缩   .h+.cpp+.exe+.dsw/.dsp+readme.txt  成包(.zip\.rar)。命名规则:班级-序号+姓名+作业1提交到datastructurecp@163.com。

注意:
1)同学们可以调用程序包里已经实现的类函数实现各个任务。
2)在Visual C++或Visual Stadio中使用单步跟踪、断点、监视窗口等工具学习并理解程序运行的逻辑。