电大数据结构(本)期末综合练习二小抄

上传人:仙*** 文档编号:29987203 上传时间:2021-10-08 格式:DOC 页数:14 大小:199.12KB
收藏 版权申诉 举报 下载
电大数据结构(本)期末综合练习二小抄_第1页
第1页 / 共14页
电大数据结构(本)期末综合练习二小抄_第2页
第2页 / 共14页
电大数据结构(本)期末综合练习二小抄_第3页
第3页 / 共14页
资源描述:

《电大数据结构(本)期末综合练习二小抄》由会员分享,可在线阅读,更多相关《电大数据结构(本)期末综合练习二小抄(14页珍藏版)》请在装配图网上搜索。

1、专业好文档数据结构(本)期末综合练习二一、单项选择题1从n个数中选取最大元素( )。 A基本操作是数据元素间的交换 B算法的时间复杂度是O(n) C算法的时间复杂度是O(n2) D需要进行(n+1)次数据元素间的比较2线性表采用链式存储时,其地址( )。A一定是不连续的 B必须是连续的C部分地址必须是连续的 D可以连续也可以不连续3设head为非空的单向循环链表头指针,p指向链表的尾结点,则满足逻辑表达式( )的值为真。Ap-next=NULL Bp-next= =headCp-next=head Dp= =NULL4带头结点的单向链表的头指针为head,该链表为空的判定条件是( )的值为真。

2、Ahead = = NULL Bhead-next= =headChead = =head-next Dhead-next= = NULL5设顺序存储的线性表长度为n,要删除第i个元素,按课本的算法,当i=( )时,移动元素的次数为3A3 Bn/2 Cn-3 D36设顺序存储的线性表长度为n,对于插入操作,设插入位置是等概率的,则插入一个元素平均移动元素的次数为( )。An Bn/2 Cn-1 Dn-i+17一个栈的进栈序列是a,b,c,d,则栈的不可能的出栈序列是( )。Adcba BbcadCcbad Dadbc 8一个栈的进栈序列是5,6,7,8,则栈的不可能的出栈序列是( )(进出栈操

3、作可以交替进行)A7,6,8,5 B5,8,6,7C7,6,5,8 D8,7,6,59设有一个带头结点的链队列,队列中每个结点由一个数据域data和指针域next组成,front和rear分别为链队列的头指针和尾指针,要执行出队操作,用x保存出队元素的值,p为指向结点类型的指针,可执行如下操作:p=front-next;x=p-data; 然后指行( )。Afront=p-next; Bfront-next =p;Cfront=p; Dfront-next=p-next;10栈和队列的相同点是( )。A都是后进先出 B都是后进后出C逻辑结构与线性表不同 D逻辑结构与线性表相同,都是操作规则受到

4、限制的线性表11在C语言中,存储字符串“ABCD”需要占用( )字节。A4 B2 C5 D312在C语言中,利用数组a存放字符串“Hello”,以下语句中正确的是( )。Achar a10= “Hello”; Bchar a10; a=“Hello”;Cchar a10= Hello; Dchar a10=H,e,l,l,o;13设有一个10阶的对称矩阵A,采用压缩存储方式将其下三角部分以行序为主序存储到一维数组b中。(矩阵A的第一个元素为a1,1,数组b的下标从1开始),则矩阵元素a5,3对应一维数组b的数组元素是( )。Ab18 Bb8 Cb13 Db1014设有一个15阶的对称矩阵A,采

5、用压缩存储方式将其下三角部分以行序为主序存储到一维数组b中。(矩阵A的第一个元素为a1,1,数组b的下标从1开始),则数组元素b13对应A的矩阵元素是( )。Aa5,3 Ba6,4 Ca7,2 Da6,815深度为5的完全二叉树共有20个结点,则第5层上有( )个结点(根所在结点为第一层)。A3 B8 C5 D616一棵完全二叉树共有30个结点,则该树一共有( )层(根结点所在层为第一层)。A6 B4 C3 D517已知一个图的所有顶点的度数之和为m,且m是以下4中情况之一,则m只可能是( )。A9 B7 C15 D818以下说法正确的是( )。 A连通图G的生成树中不一定包含G的所有顶点B连

6、通图G的生成树中一定要包含G的所有边C连通图G一定存在生成树D连通图G的生成树一定是唯一的19线性表只要以( )方式存储就能进行折半查找。A链接 B顺序 C关键字有序的顺序 D二叉树20对二叉排序树进行( )遍历,遍历所得到的序列是有序序列。 A按层次 B前序 C中序 D后序21对n个元素进行冒泡排序若某趟冒泡中只进行了( )次元素间的交换,则表明序列已经排好序。 A1 B2 C0 Dn-122以下排序算法中,在一趟排序过程中,除了其它相关操作外,只进行一次元素间的交换的算法是( )。 A冒泡 B直接选择 C直接插入 D折半插入23在对一组元素(64,48,106,33,25,82,70,55

7、,93)进行直接插入排序时,当进行到要把第7个元素70插入到已经排好序的子表时,为找到插入位置,需进行( )次元素间的比较(指由小到大排序)。A6 B2 C3 D424对长度为n的线性表进行顺序查找,在等概率情况下,平均查找长度为( )。 An B(n+1)/2 C2n Dn-125如图,若从顶点a出发按广度优先搜索法进行遍历,则可能得到的顶点序列为( )。abecdfg Aacebdgf Bacfedgb CabecdgfDabecfdg 26如图若从顶点a出发按深度优先搜索法进行遍历,则可能得到的顶点序列为( )。abecdfg AacfgedbBaedcbgfCacfebdgDaecbd

8、gf27一棵哈夫曼树有10个非叶子结点(非终端结点),该树总共有( )个结点。A21 B20 C22 D1928一棵哈夫曼树有12个叶子结点(终端结点),该树总共有( )个结点。A21 B22 C23 D2429队列的插入操作在( )进行。 A队头 B队尾 C队头或队尾 D在任意指定位置30队列的删除操作在( )进行。 A队尾 B队头 C队头或队尾 D在任意指定位置二、填空题1通常可以把某城市中各公交站点间的线路图抽象成_ _结构。2结构中的元素之间存在多对多的关系称为_ _结构。3要在一个单向链表中删除p所指向的结点,已知q指向p所指结点的直接前驱结点,若链表中结点的指针域为next,则可执

9、行_ _ _。4设有一个单向循环链表,结点的指针域为next,头指针为head,指针p指向表中某结点,若逻辑表达式_的结果为真,则p所指结点为尾结点。5设有一个链栈,栈顶指针为hs,现有一个s所指向的结点要入栈,则可执行操作_ _ 和hs=s;6设有一个链栈,栈顶指针为hs,现有一个s所指向的结点要入栈,则可执行操作s- next=hs; _ _。7在一个不带头结点的非空链队中,f和r分别为队头和队尾指针,队结点的数据域为data,指针域为next,若要进行出队操作,并用变量x存放出队元素的数据值,则相关操作为_ _; _ _ _。8在一个链队中,f和r分别为队头和队尾指针,队结点的指针域为n

10、ext,s指向一个要入队的结点,则入队操作为_ _;_ _;9顺序存储字符串“ABCD”需要占用_个字节。10循环队列的最大存储空间为MaxSize=6,采用少用一个元素空间以有效地判断栈空或栈满,若队头指针front=4,当队尾指针rear= _ _时队满,队列中共有_个元素。11一棵二叉树叶结点(终端结点)数为5,单分支结点数为2,该树共有_个结点12程序段 char *s=”aBcD”;n=0; while(*s!=0) if(*sa&*sdata=x; _(2)_; _(3)_; 2设线性表为(6,10,16,4),以下程序用说明结构变量的方法建立单向链表,并输出链表中各结点中的数据。

11、 #define NULL 0 void main( ) NODE a,b,c,d,*head,*p;a.data=6;b.data=10;c.data=16;d.data=4; /*d是尾结点*/head= (1) ;a.next=&b;b.next=&c;c.next=&d; (2) ; /*以上结束建表过程*/p=head; /*p为工作指针,准备输出链表*/do printf(“%dn”, (3) ); (4) ; while( (5) );3以下函数在head为头指针的具有头结点的单向链表中删除第i个结点, struct node int data;struct node *next

12、;typedef struct node NODE int delete(NODE *head,int i )NODE *p,*q; int j; q=head;j=0; while(q!=NULL)&( _(1)_) _(2)_;j+; if(q=NULL) return(0); p= _(3)_; _(4)_=p-next; free(_(5)_); return(1);4以下程序是中序遍历二叉树的递归算法的程序,完成程序中空格部分(树结构中左、右指针域分别为left和right,数据域data为字符型,BT指向根结点)。void Inorder (struct BTreeNode *BT

13、) if(BT!=NULL) (1) ; (2) ; (3) ; 答案一、单项选择题(每小题2分,共30分)1B 2D 3B 4D 5C 6B 7D 8B 9D 10D 11C 12A 13C 14A 15C 16D 17D 18C 19C 20C 21C 22B 23C 24B 25C 26A 27A 28C 29B 30B二、填空题(每题2分,共24分)1图状2图状3q-next= p-next;4p-next= =head;5s-next=hs;6hs=s;7x=f-data; f=f-next;8r-next=s;r=s;95103;511111221321141015、树形16、深度

14、优先;广度优先17线性 18图状(网状) 19gdbeihfca20 2n-121正确22顺序存储 链式存储23关键字相等的记录24关键字相等的记录 三、综合应用题1(1) 45 40 65 43 35 95 35 40 65 43 35 95 35 40 65 43 65 95 35 40 43 43 65 95 35 40 43 45 65 95(2) 40 45 65 43 35 95 40 43 45 65 35 95 35 40 43 45 65 952(1)s=(NODE*)malloc(sizeof(NODE);s-data=1;(2)p-next=s;s-next= NULL;

15、free(s)(3)head = head -next;(4)p1-next= p-next;p-next=p1;16423252576782428267525732161023(1)102初始树 堆(2)102,52,42,82,16,67,32,572212130191502515200100104(1)(2)4次;3次5038821311064165(1)(2)三次;四次6246167318514(1)(2)中序遍历 中序 2,3,4,5,6,7,14,16,18四、程序填空题1(1)sizeof (struct node)(2)p-next=top(3)top=p2 (1)&a(2)d

16、next=NULL(3)p-data(4)p=p-next(5)p!=NULL3(1)jnext(3)q-next(4)q-next(5)p4 (1)Inorder(BT-left)(2)printf(“%c”,BT-data)(3) Inorder(BT-right)If we dont do that it will go on and go on. We have to stop it; we need the courage to do it.His comments came hours after Fifa vice-president Jeffrey Webb - also in

17、 London for the FAs celebrations - said he wanted to meet Ivory Coast international Toure to discuss his complaint.CSKA general director Roman Babaev says the matter has been exaggerated by the Ivorian and the British media.Blatter, 77, said: It has been decided by the Fifa congress that it is a non

18、sense for racism to be dealt with with fines. You can always find money from somebody to pay them.It is a nonsense to have matches played without spectators because it is against the spirit of football and against the visiting team. It is all nonsense.We can do something better to fight racism and d

19、iscrimination.This is one of the villains we have today in our game. But it is only with harsh sanctions that racism and discrimination can be washed out of football.The (lack of) air up there Watch mCayman Islands-based Webb, the head of Fifas anti-racism taskforce, is in London for the Football As

20、sociations 150th anniversary celebrations and will attend Citys Premier League match at Chelsea on Sunday.I am going to be at the match tomorrow and I have asked to meet Yaya Toure, he told BBC Sport.For me its about how he felt and I would like to speak to him first to find out what his experience

21、was.Uefa hasopened disciplinary proceedings against CSKAfor the racist behaviour of their fans duringCitys 2-1 win.Michel Platini, president of European footballs governing body, has also ordered an immediate investigation into the referees actions.CSKA said they were surprised and disappointed by T

22、oures complaint. In a statement the Russian side added: We found no racist insults from fans of CSKA.Baumgartner the disappointing news: Mission aborted.The supersonic descent could happen as early as Sunda.The weather plays an important role in this mission. Starting at the ground, conditions have

23、to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. The balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 mi

24、les/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.The balloon will slowly drift to the edge of space at 120,000

25、 feet ( Then, I would assume, he will slowly step out onto something resembling an Olympic diving platform.Below, the Earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. Still, hell be traveling fast, so despite the distance, it will not be like diving in

26、to the deep end of a pool. It will be like he is diving into the shallow end.Skydiver preps for the big jumpWhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the more de

27、nse air closer to Earth. But this will not be enough to stop him completely.If he goes too fast or spins out of control, he has a stabilization parachute that can be deployed to slow him down. His team hopes its not needed. Instead, he plans to deploy his 270-square-foot (25-square-meter) main chute

28、 at an altitude of around 5,000 feet (1,524 meters).In order to deploy this chute successfully, he will have to slow to 172 mph (277 kph). He will have a reserve parachute that will open automatically if he loses consciousness at mach speeds.Even if everything goes as planned, it wont. Baumgartner still will free fall at a speed that would cause you and me to pass out, and no parachute is guaranteed to work higher than 25,000 feet (7,620 meters).cause there

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!