文件名称:顺序表的应用
介绍说明--下载内容来自于网络,使用问题请自行百度
顺序表的应用
(1) 已知长度为n的线性表A采用顺序存储结构,请写一时间复杂度为0(n)、空间复杂度为0(1)的算法,该算法删除线性表中所有值为item的数据元素。要求:线性表元素个数n很大,而值为item的数据元素个数很少,要求移动元素个数尽量少;删除后的数组元素与原数组元素不必保持顺序一致。
(2)编写一个函数将一个顺序表A(有n个元素,且任何元素均不为0)分拆成两个顺序表,使A中大于0的元素存放在B中,小于0的元素存放在C中。
(3)假设一个算术表达式中包含圆括号,方括号和花号三种类型的括号,编写一个判别表达式中括号是否正确配对的函数correct(exp,tag);其中:exp为字符串类型量,表示被判别的表达式,tag为布尔型的变量。
(4)编写向顺序分配的循环队列QU[0,m-1]中插入一个结点的函数enqueue和从该队列中取出一个节点的dequeue函数。
(5)编写一个主函数,调试上述算法。
-The application of the order form
(1) of length n given in Table A using the linear sequence of storage structure, please write a time complexity 0 (n), space complexity is 0 (1) of the algorithm to delete all the values of the linear form for the item of data elements. Requirements: n number of elements in a large linear table, while the number of data elements is very little item, requiring as little as possible the number of mobile elements to delete array element after the array elements do not have to maintain the original order of the same.
(2) write a function to a sequence of Table A (with n elements, and any element not 0) the order split into two tables, so that A is greater than 0 in the element is stored in B, is less than 0 elements stored in C.
(3) assuming an arithmetic expression contains parentheses, brackets, and three types of flower number in parentheses, the expression in parentheses write a discriminant function correctly matching correct (exp
(1) 已知长度为n的线性表A采用顺序存储结构,请写一时间复杂度为0(n)、空间复杂度为0(1)的算法,该算法删除线性表中所有值为item的数据元素。要求:线性表元素个数n很大,而值为item的数据元素个数很少,要求移动元素个数尽量少;删除后的数组元素与原数组元素不必保持顺序一致。
(2)编写一个函数将一个顺序表A(有n个元素,且任何元素均不为0)分拆成两个顺序表,使A中大于0的元素存放在B中,小于0的元素存放在C中。
(3)假设一个算术表达式中包含圆括号,方括号和花号三种类型的括号,编写一个判别表达式中括号是否正确配对的函数correct(exp,tag);其中:exp为字符串类型量,表示被判别的表达式,tag为布尔型的变量。
(4)编写向顺序分配的循环队列QU[0,m-1]中插入一个结点的函数enqueue和从该队列中取出一个节点的dequeue函数。
(5)编写一个主函数,调试上述算法。
-The application of the order form
(1) of length n given in Table A using the linear sequence of storage structure, please write a time complexity 0 (n), space complexity is 0 (1) of the algorithm to delete all the values of the linear form for the item of data elements. Requirements: n number of elements in a large linear table, while the number of data elements is very little item, requiring as little as possible the number of mobile elements to delete array element after the array elements do not have to maintain the original order of the same.
(2) write a function to a sequence of Table A (with n elements, and any element not 0) the order split into two tables, so that A is greater than 0 in the element is stored in B, is less than 0 elements stored in C.
(3) assuming an arithmetic expression contains parentheses, brackets, and three types of flower number in parentheses, the expression in parentheses write a discriminant function correctly matching correct (exp
(系统自动生成,下载前可以参看下载内容)
下载文件列表
数据结构程序设计/总.txt
数据结构程序设计
数据结构程序设计
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.