文件名称:list
介绍说明--下载内容均来自于网络,请自行研究使用
利用顺序表的操作,实现以下的函数。
(1) 从顺序表中删除具有最小值的元素并由函数返回被删元素的值。空出的位置由最后一个元素填补,若顺序表为空则显示出错信息并退出运行。
(2) 从顺序表中删除第i个元素并由函数返回被删元素的值。如果i不合理或顺序表为空则显示出错信息并退出运行。
(3) 向顺序表中第i个位置插入一个新的元素x。如果i不合理则显示出错信息并退出运行。
(4) 从顺序表中删除具有给定值x的所有元素。
(5) 从顺序表中删除其值在给定值s与t之间(要求s小于t)的所有元素,如果s或t不合理或顺序表为空则显示出错信息并退出运行。
(6) 从有序顺序表中删除其值在给定值s与t之间(要求s小于t)的所有元素,如果s或t不合理或顺序表为空则显示出错信息并退出运行。
(7) 将两个有序顺序表合并成一个新的有序顺序表并由函数返回结果顺序表。
(8) 从顺序表中删除所有其值重复的元素,使表中所有元素的值均不相同。
-The operation of the order table to achieve the following functions.
(1) is removed from the order table with the minimum elements and the function returns the value of the element being deleted. Vacated position be filled by the last element, if the sequence table is empty, display an error message and quit running.
(2) remove the i-th element from the sequence table and the function returns the value of the element being deleted. If i unreasonable or order of the table is empty, display an error message and exit running.
(3) insert a new element x to the position of the specified order table. If i unreasonable display an error message and exit run.
(4) is removed from the order table has all the elements of a given value of x.
(5) is removed from the order table, all the elements of its value between a given value of s and t (s is less than t), if s or t is unreasonable or order of the table is empty, display an error message and exit running.
(6) is rem
(1) 从顺序表中删除具有最小值的元素并由函数返回被删元素的值。空出的位置由最后一个元素填补,若顺序表为空则显示出错信息并退出运行。
(2) 从顺序表中删除第i个元素并由函数返回被删元素的值。如果i不合理或顺序表为空则显示出错信息并退出运行。
(3) 向顺序表中第i个位置插入一个新的元素x。如果i不合理则显示出错信息并退出运行。
(4) 从顺序表中删除具有给定值x的所有元素。
(5) 从顺序表中删除其值在给定值s与t之间(要求s小于t)的所有元素,如果s或t不合理或顺序表为空则显示出错信息并退出运行。
(6) 从有序顺序表中删除其值在给定值s与t之间(要求s小于t)的所有元素,如果s或t不合理或顺序表为空则显示出错信息并退出运行。
(7) 将两个有序顺序表合并成一个新的有序顺序表并由函数返回结果顺序表。
(8) 从顺序表中删除所有其值重复的元素,使表中所有元素的值均不相同。
-The operation of the order table to achieve the following functions.
(1) is removed from the order table with the minimum elements and the function returns the value of the element being deleted. Vacated position be filled by the last element, if the sequence table is empty, display an error message and quit running.
(2) remove the i-th element from the sequence table and the function returns the value of the element being deleted. If i unreasonable or order of the table is empty, display an error message and exit running.
(3) insert a new element x to the position of the specified order table. If i unreasonable display an error message and exit run.
(4) is removed from the order table has all the elements of a given value of x.
(5) is removed from the order table, all the elements of its value between a given value of s and t (s is less than t), if s or t is unreasonable or order of the table is empty, display an error message and exit running.
(6) is rem
(系统自动生成,下载前可以参看下载内容)
下载文件列表
list.cpp