文件名称:sLinkList
介绍说明--下载内容来自于网络,使用问题请自行百度
项目任务
在单链表类中增加一个功能erase(x, y), 删除表中所有值在 [x, y] 之间的结点。假设链表中结点数值类型是整形,要求编程返回删除相应结点后的链表长度和链表元素。
输入描述
第一行输入链表List的结点元素值,元素之间用空格间隔,且均为int类型;
第二行输入为x和y,分别表示需要删除结点元素的最小值和最大值。
输出描述
第一行输出删除相应结点后链表的长度;
第二行输出删除相应结点后链表的所有元素,元素之间用空格间隔。若无剩余元素,输出null。(Project tasks
A function erase (x, y) is added to the class of single linked list to delete all nodes whose values are between [x, y]. Assuming that the numerical type of the node in the linked list is plastic, the program is required to return the length and elements of the linked list after deleting the corresponding nodes.
Enter a descr iption
In the first line, enter the node element values of the linked list list, with spaces between the elements, and all of them are of type int;
In the second line, input X and y to indicate the minimum and maximum values of node elements to be deleted.
Output descr iption
The first line outputs the length of the linked list after deleting the corresponding node;
The second line outputs all the elements of the linked list after deleting the corresponding nodes, with space between the elements. If there are no remaining elements, null is output.)
在单链表类中增加一个功能erase(x, y), 删除表中所有值在 [x, y] 之间的结点。假设链表中结点数值类型是整形,要求编程返回删除相应结点后的链表长度和链表元素。
输入描述
第一行输入链表List的结点元素值,元素之间用空格间隔,且均为int类型;
第二行输入为x和y,分别表示需要删除结点元素的最小值和最大值。
输出描述
第一行输出删除相应结点后链表的长度;
第二行输出删除相应结点后链表的所有元素,元素之间用空格间隔。若无剩余元素,输出null。(Project tasks
A function erase (x, y) is added to the class of single linked list to delete all nodes whose values are between [x, y]. Assuming that the numerical type of the node in the linked list is plastic, the program is required to return the length and elements of the linked list after deleting the corresponding nodes.
Enter a descr iption
In the first line, enter the node element values of the linked list list, with spaces between the elements, and all of them are of type int;
In the second line, input X and y to indicate the minimum and maximum values of node elements to be deleted.
Output descr iption
The first line outputs the length of the linked list after deleting the corresponding node;
The second line outputs all the elements of the linked list after deleting the corresponding nodes, with space between the elements. If there are no remaining elements, null is output.)
相关搜索: 单链表 删除
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
qwer\main.cpp | 671 | 2020-11-04 |
qwer\sLinkList.cpp | 614 | 2020-11-04 |
qwer\sLinkList.h | 234 | 2020-11-04 |
qwer | 0 | 2020-11-04 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.