2017年韩山师范学院本科插班生考试试题《数据结构》A卷
专升本《数据结构》 试卷 答案

专升本《数据结构》试卷答案专升本《数据结构》-试卷-答案专升本《数据结构》一、(共75题,共150分后)1.数据的逻辑结构是由()部分组成的。
(2分)a.2b.3c.4d.5标准答案:a2.算法是对某一类问题求解步骤的有限序列,并具有()个特性。
(2分)a.3b.4c.5d.6标准答案:c3.队列的入队操作是在()进行的。
(2分)a.队头b.队尾c.任意位置d.指定位置标准答案:b4.队列的出队操作是在()进行的。
(2分)a.队头b.队尾c.任意位置d.指定位置标准答案:a5.数组通常采用顺序存储的优点是()。
(2分)a.便于增加存储空间b.便于依据下标进行随机存取c.避免数据元素的移动d.防止下标溢出标准答案:b6.下列给出的操作中,()是允许对队列进行的操作。
(2分)a.删除队首元素b.取出最近进队的元素c.按元素大小排序d.中间插入元素标准答案:a7.采用带头结点的单链表存储的线性表,若表长为n,在删除第号元素时,需要移动指针()次。
(2分)a.k+1b.kc.k-1d.k-2标准答案:c8.字符数组a[1..100]使用顺序存储,a[6]地址就是517,则a的首地址为()。
(2分后)a.510b.512c.514d.516标准答案:b9.深度为n的全然二叉树最多存有()个结点。
(2分后)a.2n+1b.2n-1c.2nd.2n-1标准答案:d10.若二叉树对应的二叉链表共计n个非空链域,则该二叉树存有()个结点的二叉树。
(2分后)a.n-1b.nc.n+1d.2n标准答案:a11.下面描述错误的就是()。
(2分后)a.借助队列可以同时实现对图的广度优先结点b.二叉树中序结点的序列就是有序c.只有一个结点的二叉树的度为0d.空格串是指由1个或以上的空格符号组成的串标准答案:b12.以下与数据的存储结构无关的术语是()。
(2分)a.循环队列b.链表c.哈希表d.栈标准答案:d13.在一个长度为n的链式栈中入栈实现算法的时间复杂度为()。
2017年韩山师范学院本科插班生考试试题《高级程序设计语言》A卷

韩山师范学院2017年本科插班生考试试卷计算机科学与技术专业 高级语言程序设计试卷(A 卷)一、填空题(每空2分,共10分)1.C 程序的基本组成单位是 函数 。
2.当a=1,b=35,c=5时,表达式a!=b>c 的值是 _____ 0 __。
3. 一个C 文件是一个__字节流__流或二进制流。
4. 一个字符数据既可以以字符形式输出,也可以以_ 整形 _形式输出。
5. 若a 是int 型变量,且a 的初值为6,则执行表达式a+=a-=a*a 后,a 的值为 -24 。
二、单项选择题(每题2分,共30分)1.下述程序段的输出结果是(D)。
int x=10;int y=x--;printf("%d,%d",(y++,x),y++);A、9,10B、11,10C、10,9D、9,11逗号运算符:表达式用逗号分开,所以最终的值应该是最后一个表达式的值2.下面各选项中,均是C语言标识符的选项组是(C)。
A、for china toB、void union _342C、long_123 short56 _doD、text.txt _075 _3ew 3.若int k=10;则执行下列程序后,变量k的正确结果是(B)。
main( ){ int k=10;switch(k){ case 9: k+=1;case 10: k+=1;break;case 11: k+=1;default: k+=1}printf(″%d\n″,k);}A、12B、11C、10D、94.在位运算中,操作数每右移一位,其结果相当于(A)。
A、操作数除以2B、操作数乘以16C、操作数除以16D、操作数乘以2左移乘二,右移除以2,都是整除5.以下能对二维数组c进行正确的初始化的语句是(B)。
A、int c[][5]={{1},{},{4}};B、int c[][5]={{1},{2},{4}};C、int c[5][]={{2},{8},{4},{5}};D、int c[5][]={{6},{6},{9}};6、以下程序执行后,sum的值是(A)。
2018年本科插班生考试试题《数据结构》A试卷

韩山师范学院2018年本科插班生考试试卷计算机科学与技术 专业 数据结构 试卷(A 卷)一、单项选择题(每题2分,共30分)1. 数据的最小单位是( )。
A. 数据元素 B.数据项 C.数据类型 D. 数据变量2. 一个栈的输入序列为A B C ,则下列序列中不可能是栈的输出序列的是( )。
A. B C AB.C B AC. C A BD. A B C 3.程序段s=i=0;do {i=i+1; s=s+i ;}while(i<=n);的时间复杂度为( )。
A. O(n)B. O(nlog 2n)C.O(n 2)D.O(n 3/2)4.一个非空广义表的表头( )。
A.不可能是子表B.只能是子表C.只能是原子D.可以是子表或原子5.设顺序循环队列Q[0:M-1]的头指针和尾指针分别为F 和R ,头指针F 总是指向队头元素的前一位置,尾指针R 总是指向队尾元素的当前位置,则该循环队列中的元素个数为( )。
A. R-FB.F-RC. (F-R+M)%MD. (R-F+M)%M6.设指针变量p 指向单链表中结点A ,若删除单链表中结点A ,则需要修改指针的操作序列为( )。
A. q=p->next ;p->next=q->next ;free(q);B. q=p->next ;p->data=q->data ;free(q);C. q=p->next ;p->data=q->data ;p->next=q->next ;free(q);D. q=p->next ;q->data=p->data ;p->next=q->next ;free(q);7.设有一个二维数组A [m ][n ],假设A [0][0]存放位置在644(10),A [2][2]存放位置在676(10),每个元素占一个空间,问A [3][3](10)存放在什么位置?脚注(10)表示用10进制表示( )。
2018年韩山师范学院本科插班生《数据结构》考试大纲

2018年韩山师范学院本科插班生《数据结构》考试大纲第一篇:2018年韩山师范学院本科插班生《数据结构》考试大纲《数据结构》考试大纲I 考试的性质与目的本科插班生考试是由专科毕业生参加的选拔性考试。
《数据结构》是计算机科学与技术专业(本科)的一门专业基础课程,考试主要检查考生对常用基本数据结构(顺序表、链表、栈、队列、树、二叉树、图等)的逻辑结构、存储结构和相应算法的掌握程度,以保证后续课程的学习。
II 考试的内容一、考试基本要求1、基本理论知识(l)、数据结构的基本概念和基本术语,算法的描述方法和算法分析的基本概念。
(2)、线性表的基本概念、线性表的基本操作以及这些操作分别在顺序存储和链式存储结构下的实现及复杂度分析。
(3)、栈和队列的定义、存储结构、实现和典型应用。
(4)、串的定义及其基本操作。
(5)、数组的定义、运算和存储,稀疏矩阵的压缩存储。
(6)、树的定义、基本术语和存储结构,二叉树的定义和性质、二叉树的存储结构及其各种操作,哈夫曼树的概念和应用。
(7)、图的定义和术语、图的存储结构及其各种操作。
(8)、各种查找方法的算法、适用范围及时间复杂度的分析。
(9)、多种内排算法的基本思想和算法的时间复杂度分析,不同排序方法的比较。
2、基本技能(1)、能阅读用类C语言编写的算法。
(2)、能分析算法所完成的功能、运行结果和时间复杂度。
(3)、能根据要求用类C语言编写算法。
二、考核知识点及考核要求第一章绪论一、考核知识点1.数据、数据元素、数据项、数据对象、数据结构、逻辑结构、物理结构、元素、结点等基本概念。
抽象数据类型的定义、表示和实现方法。
2.算法、算法的特性、如何用类C语言来描述算法。
3.算法设计的基本要求以及计算语句频度和估算算法时间复杂度的方法。
二、考核要求1.识记:有关数据结构的基本概念,四种基本数据结构的特点。
2.理解:四种基本数据结构的基本运算,算法复杂度度量的基本概念。
3.应用:用类C语言描述算法第二章线性表一、考核知识点1.线性表的定义和基本操作。
2017年韩山师范学院本科插班生《C语言程序的设计》试卷

2017年韩山师范学院本科插班生考试试卷计算机科学与技术专业高级语言程序设计试卷(A卷)一、填空题(每空1分,共10分)1.一个C程序的执行是从本程序的函数开始。
2.结构化程序的三种基本结构为顺序结构、_________________、_________________。
3.能表示“整型变量x的绝对值小于5”的C语言表达式是________________ (不得使用系统函数)。
4.在C语言中,当表达式值为0时表示逻辑值“假”,当表达式值为________________时表示逻辑值“真”。
5.在位运算中,操作数每左移一位(无溢出),其结果相当于操作数____________以2。
6.设有定义FILE *fp; 则关闭fp对应文件的操作语句是。
7.在C程序中,根据数据的组织形式可以可分为___________文件和___________文件。
8.若有定义char s[]="\n123\\"; 则strlen(s)的值为_______;sizeof(s)的值为_______。
二、单项选择题(每小题1.5分,共30分)1.C语言中的标识符只能由字母、数字和下划线,且第一个字符( )。
A.必须为字母B.必须为下划线C.必须为字母或下划线D. 可以是字母或数字或下划线2.设a,b为整型变量,以下合法的表达式为( )。
A. b=a/2B. b=*a+2C. b+a=2D. b=a%2.53.以下选项中能表示合法常量的是A.整数:1,200B.实数:1.5E2.0C.字符斜杠:'\'D.字符串:"\007"4.若有a=4,b=3,c=5,则表达式a<b<c的值为( )。
A. 1B. 表达式不合法C. 0D. 25.下列关于指针变量赋空值的说法错误的是A.当赋空值的时候,变量指向地址为0的存储单元B.赋值语句可以表达为变量名=´\0´;C.赋值语句可以表达为变量名=0;D.一个指针变量可以被赋空值6.下列程序的运行结果是( )。
(完整word版)2018年韩山师范学院本科插班生考试试题《高级语言程序设计》A卷

韩山师范学院2018年本科插班生考试试卷计算机科学与技术专业 高级语言程序设计试卷(A 卷)一、填空题(每空2分,共10分)1.C 程序源文件的后缀名是 .C 。
2.设变量a 的值是1,则表达式(2+a )∧(~3)的值是_ _____ 。
3. fgetc 函数的作用是从指定文件读入一个 字符 。
4. C 语言程序至少必须包含一个 main 函数。
5. 若有定义:int a[3][5];则数组a 中共有__15__个元素。
二、单项选择题(每题2分,共30分)1.C 语言程序编译时,程序中的注释部分___B_______。
A.不参加编译,但会出现在目标程序中B.不参加编译,也不会出现在目标程序中C.参加编译,但不会出现在目标程序中D.参加编译,并会出现在目标程序中2.以下程序执行后sum的值是___A_______。
A.15 B.不确定C.14 D.0main(){ int i , sum=0;for(i=1;i<6;i++) sum+=i;printf("%d\n",sum);}3.下列程序段的输出结果是__A________。
A.2 1 4 3 B.1 2 1 2 C.1 2 3 4 D.2 1 1 2void fun(int *x, int *y){ printf("%d %d ", *x, *y); *x=3; *y=4;}main(){ int x=1,y=2;fun(&y,&x);printf("%d %d",x, y);}//解析:本题中函数传递的是变量的地址,如果形参在函数中发生改变,相对应的实参也就有了改变4.以下程序的输出结果是____D______。
main(){ char c='a';printf("%c",c+25);}A.A B.a C.a+25 D.z5. 以下能正确定义,且赋初值的语句是___B______A. int n1=n2=10;B. char c=32;C. Float f=f+1;D. double x=12.3E2.56. 以下程序的输出结果是____B______main(){ char ch[3][5]={"AAAA","BBB","CC"};printf("\"%s\"\n",ch[1]); //指的是第二个元素}A."AAAA" B."BBB" C."BBBCC" D."CC"7. 设有定义:int a=3,b,*p=&a;则下列使b不为3的语句是___D______A.b=*&aB.b=*pC.b=aD.b=*a8. 若有说明语句:int a,b,c,*d=&c;,则能正确从键盘读入三个整数分别赋给变量a、b、c 的语句是___A_______。
2017年韩山师范学院本科插班生考试《英语语法》A卷

韩山师范学院2017年本科插班生考试试卷英语 专业 英语语法 试卷(A 卷)一、Choose the correct answer (每题1分,共40分)Direction: Complete the following sentences and then blacken the corresponding letter on the ANSWER SHEET.1.______ can get a better view of the game than the participants.A. Looker-onB. Lookers-onC. Looker-onsD. Lookers-ons2. My mother cut the cloth with ______ scissors.A. aB. twoC. a couple ofD. a pair of3.______ receives only a small portion of the total amount of the sun’s energy.A . The earth’s surface B. The surface earthC. The surface of earthD. The earth surface4. Little boys are easily ______.A. taken outB. taken awayC. taken inD. taken over5. The thief ran away as fast as he could ______ the policeman.A. in sightB. within the sight ofC. within sightD. at the sight of6. Prior ______ his departure, he wrote a letter to his mother.A. ofB. fromC. toD. in7. ______ classical music, which follows formal European traditions, jazz is a spontaneous and free form.A. In comparison withB. In connection withC. In regard toD. In contrast to8. The investigators found that more should be done for ______ in India.A. the poorB. a poorC. poorD. those poor9. A man suffering from a chock should be given ______.A. hot sweet teaB. a hot sweet teaC. the hot sweet teaD. one hot sweet tea10. Under no circumstances will there be wage control while I am ______ of the government.A. the headB. headC. a headD. that head11. We have produced ______ this year as we did in 1993.A. as much cotton twiceB. as twice much cottonC. much as twice cottonD. twice as much cotton12. With the miniaturization of the structural components the weight of these electric devices has decreased ______ 30%.A. byB. withC. inD. as13. Most English people go to Spain for the sea, the sun and all the ______ things associated with a relaxing holiday.A. any b. another C. other D. some14. I cannot invited ______ of you, since I’ve got only one extra ticket.A. eitherB. bothC. someD. one15. The little baby was left alone, with ______ to look after it.A. someoneB. anyoneC. not oneD. no one16. Frank admired his friends Tom and David. He imitated ______.A. theirs every actionB. every action of theirsC. every of their actionD. every action of their one17. The modern machine proved ______ in heart surgery.A. high valuableB. highly valuableC. valuable highD. valuable highly18. Tuition at American university runs ______ one thousand dollars a semester.A. so high asB. as high toC. as high asD. as higher than19. If negotiations for the new trade agreements take ______, critical food shortages will develop in several countries.A. too much longerB. much too longC. the longestD. the longer20. Many scientists ______ their own eyes and ears than the theories of the ancients.A. would rather to believeB. will rather believeC. rather would believeD. would rather believe21. “We didn’t see him at the lecture yesterday.” “He ______ it.”A. mustn’t attendB. cannot have attendedC. would have not attendedD. needn’t have attended22. ______ that bad weather was on the way, the climbers decided to put off their attempt on Eiger until the following week.A. Having toldB. Being toldC. TellingD. Having been told23. You must follow the directions exactly and if you become ______, you must take the time to go back again and reread them.A. to confuseB. confusingC. confusedD. confuse24. What’s the use ______ extra leisure time if you don’t know what to do?A. of knowingB. to haveC. being haveD. have25. I have tried _______ worrying about it.A. to stop consciouslyB. to consciously stopC. to conscious stoppingD. to stopping consciously26. Now that you _______ , what are you going to do?A. are being returnedB. have been returningC. have been returnedD. have returned27. The little girl ______ by the drug-pusher to carry drugs into the country.A. was made useB. was made usedC. was made use ofD. was made used of28. ______ a meeting this afternoon.A. There going to beB. There will be going to beC. There is going to beD. There will going to be29. By the time the course ends,______ a lot about Britain.A. we’ll learntB. we are learningC. we have learntD. we’ll have learnt30. I suppose you’re not going today, ______?A. are youB. do youC. don’t youD. aren’t you31. ______ that this region was so rich in natural resources.A. Little he knewB. Little did he knowC. Little he did knowD. Little he had known32. ______ was wrong.A. Not the teacher but the studentsB. Both the students and the teacherC. Neither the teacher not the studentsD. Not the students but the teacher33. The Smiths ______ their breakfast when the morning post came.A. were havingB. has been havingC. are havingD. had34. Were it not for the adoption of the open policy, things ______ they are today.A. would never beB. could have beenC. would never have beenD. didn’t have35. Einstein’s theory of relativity seemed hard to believe at the time ______.A. when he first introducedB. that he first introduced itC. he first introducedD. which he first introduced it36. The time will surely come ______ ordinary people could operate computers as well.A. whileB. whenC. asD. on which37. _____ human beings depend to a great extent on forests, every effort must be made to preserve trees and wildlife.A. IfB. UnlessC. UntilD. Since38. No one has _____ been able to trace the author of the poem.A. stillB. yetC. alreadyD. just39. Will all those _____ the proposal raise their hands?A. in relation toB. in excess ofC. in contrast toD. in favor of40. I used to be able to play well but I'm _____ now.A. out of dateB. out of touchC. out of practiceD. out of place二、Correct the errors in the following sentences.(每题1分,共20分)Directions: Identify the one that would not be acceptablein standard written English. Mark out the incorrect one and correct it. And then write down your answers on the ANSWER SHEET.1. He had joined the Party for ten years before he was transferred to the city.A B C D2. Because radio communication had failed once before, I was afraid the men inA Bthe crew on the plane might be lost touch with the control tower.C D3. From the measure adopted by the committee, higher retirement age will notA Bgo into effect for two years.C D4. It is this marvelous continuity found in the human condition in any centuryA Bthat make the reading of masterpieces so fascinating.C D5. The president mentioned to the cabinet members he was going to negotiate aA B Cnew treaty with the foreign minister.D6. My brother doesn’t care how much does the car cost because he is going to buyA B C Dit anyway.7. Having finished high school, the village education board appointed him to aA B C teaching post in the primary school.D8. He sold the vegetables at half price, therefore they would go bad.A B C D9. Doctors often study film records of complex operations for improvingA B Ctheir own knowledge and skill.D10. If a crisis was to occur, those unfamiliar with the proceduresA Bwould not know how to handle the situation.C D11. The harder she tried, the more badly she danced before such a large audience.A B C D12. It was not until very recent times that had the theory of “probability” beenA B Clooked upon as hardly more than a curiosity.D13. He had trouble finding out that the capital of that country lay on the coast or inA B C Dthe mountains.14. As a result from hearing from the radio announcement, Peter has written toA Boffer himself as a member of the panel for next week.C D15. Learning a foreign language is especially difficult for those who had neverA B Clearned one before.D16. It often mistakenly supposed that the most expensive things are always the best.A B C D17. Some international students use a cassette recorder to make tapes of theirA Bclasses so that they can repeat the lecture again.C D18. To become a member of the civic association, one need only attend threeA Bmeetings and to pay his fees regularly.C D19. Thomas was a real friend, for he advised me as well as helping me with myA B C Arabic.D20. Some find swimming more enjoyable than to sit at home reading.A B C D三、Put the verbs in brackets in the correct form.(每空1分,共20分)1. The boy, who had remained silent and deep in thought on the journey home, _____(reply) in a way that shocked his father.2. For example, the proverb, “plucking a crop _____ (help) it grow”, is based on the following story.3. They use computers to keep the traffic _____ (run) smoothly.4. Up to now, the program _____ (save) thousands of children who would otherwise have died.5. The Group of Eight, or G8, _____ (form) by eight o f the world’s wealthiestnations in 1998.6. Barbara is easy to recognize as she’s the only one of the women who _____ (wear) an evening dress.7. Liuxiang was the first Asian _____ (win) the men’s 110m hurdles at the Olympics in Athens.8. When the first English settlers arrived in the New World, the Indians wearing jewelry made of animal bones ___(greet) them warmly.9. Do you believe that there is a _____ (connect) between smoking and heart disease?10. She stared at the painting, wondering where she _____ (see) it.11. By the end of next year they _______(complete) the task.12. A good deal of British car manufacture _______ (closely tie with) the continental industry.13. He held out a suggestion that the working part ________ (machine) in a more efficient way.14. Part of the light _______ (strike) the surface will be reflected from it.15. ____(remind) not to miss the flight at 15:30, the manager set out for the airport in a hurry.16. They ______(build) a new bridge over the river since May.17. Their letters ______ (not arrive) when they ______(leave) home this morning.18. She _________ (not want) to stay in bed while the others _________ (all,四、Fill in the blanks with proper prep., adv.,determiner, coordinator or subordinator.(每空1分,共10分)1.Mr. Brown showed his dissatisfaction ______your delay.2.The two companies are completely independent. There is no connection______ them.3.Don’t blame him for this; I am responsible ______that has happened.4.We managed to keep the fire in check, but we couldn’t put it _____.5.Medical research has shown that the widespread use of cigarettes contributes______the increase of cancers.6.He decided to make further improvements on the computer’s design ______the light of the requirements of customers.7.Finding a job in such a big company has always been ______ his wildestdreams.8.He was not conscious ______ what an important discovery he had made.9.He stood there with his back _______ the wall.10.That mountain is about two thousand feet _____ sea level.五、Rewrite the following sentences according to therequirements. (每题1分,共10分)1. Combine the sentence by using infinitive “to”She is so excited that she can’t utter one word.2. Use “there be” structure to rewrite the following sentence:Three accidents have occurred at this crossroads this week.3. Rewrite the following sentence with anticipatory “it”:How she came to have such a valuable painting is a mystery.4. Rewrite the given situation into subjunctive mood:I did not bring enough money with me, so I can’t take a taxi now.5. Put the following sentence into indirect speech:“I’ll be waiting for you in the office tonight,” David said.6. Join the sentences by changing the second into a non-restrictive attributive clause:The postman came to the back door. He is new in the district.7. Rewrite the following sentence so that it contains an adverbial clause.Hearing the news they immediately set off for Shanghai.8. Rewrite the underlined parts by using inversion.A temple stands at the foot of the mountain.9. Rewrite the underlined sentence with the emphasized pattern “it is …that/who/which”.She didn’t know her mother was ill in bed until she came home from work.10. Combine the following sentences by using an absolute construction (独立主格结构)There was no way for me to cross. I walked upstream on the south side.。
20XX年韩山师范学院本科插班生考试《数据结构》课程试卷

20xx年韩山师范学院本科插班生考试《数据结构》课程试卷韩山师范学院20xx年本科插班生考试试卷计算机科学与技术专业数据结构试卷(A 卷)一、单项选择题(每题2分,共30分)1. 栈和队列的共同特点是( A )。
A. 只允许在端点处插入和删除元素B. 都是先进后出C. 都是先进先出D. 没有共同点 2. 用链接方式存储的队列,在进行插入运算时( D )。
A. 仅修改头指针 B. 头、尾指针都要修改 C. 仅修改尾指针 D. 头、尾指针可能都要修改3. 以下数据结构中哪一个是非线性结构?( D )A. 队列B. 栈C. 线性表D. 二叉树4. 设有一个二维数组A[m][n],假设A[0][0]存放位置在644,A[2][2]存放位置在676,每个元素占一个空间,问A[3][3]存放在什么位置?( C ) A .688 B .678 C .692 D .696//对的.676+(676-644)/2A[2][2]与A[0][0] 相差两排零2个元素A[3][3]与A[2][2] 相差一排零1个元素因为元素的地址是连续的5. 树最适合用来表示( C )。
A.有序数据元素B.无序数据元素C.元素之间具有分支层次关系的数据D.元素之间无联系的数据6. 二叉树的第k层的结点数最多为( D )。
A.2k-1 B.2K+1 C.2K-1 D. 2k-17. 设有向无环图G中的有向边集合E={,,,},则下列属于该有向图G的一种拓扑排序序列的是(A)。
A. 1,2,3,4B. 2,3,4,1C. 1,4,2,3D. 1,2,4,3//拓扑排序,每个结点的所有前驱结点都排在该结点的前面。
有向无环图中,拓扑排序:1.包含所有顶点2.若序列有顶点A在B的前面,则图不存在B->A的边。
即,若图中存在B->A,则B 在A的前面故BCD不对8. 下列关于数据结构的叙述中,正确的是(A)。
A. 数组是同类型值的集合B. 树是一种线性结构C. 一般情况下递归算法的程序结构更为精炼、效率更高D. 用一维数组存储二叉树,总是以先序遍历的顺序存储各结点9. 对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K % 9作为散列函数,则散列地址为1的元素有(D)个。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
韩山师范学院2017年本科插班生考试试卷计算机科学与技术 专业 数据结构 试卷(A 卷)一、单项选择题(每题2分,共30分)1. 对线性表,在下列哪种情况下应当采用链表表示?( B ) A. 经常需要随机地存取元素 B. 经常需要进行插入和删除操作 C. 表中元素需要占据一片连续的存储空间 D. 表中元素的个数不变2. 一个栈的输入序列为1 2 3,则下列序列中不可能是栈的输出序列的是( C )。
A. 2 3B. 3 2 1C. 3 1 2D. 1 2 33.程序段s=i=0;do {i=i+1; s=s+i ;}while(i<=n);的时间复杂度为( A )。
A. O(n)B. O(nlog 2n)C.O(n 2)D.O(n 3/2)4.一个非空广义表的表头( D )。
A.不可能是子表B.只能是子表C.只能是原子D.可以是子表或原子5.设数组data[m]作为循环队列SQ 的存储空间,front 为队头指针,rear 为队尾指针,则执行出队操作后其头指针front 值为( D )。
A. front=front+1 B. front=(front+1)%(m-1)C. front=(front-1)%mD. front=(front+1)%m6.在一个单链表中,若q 所指结点是p 所指结点的前驱结点,若在q 与p 之间插入一个s 所指的结点,则执行( C )。
A. s →link=p →link; p →link=s;B. p →link=s; s →link=q;C. q →link=s; s →link =p;D. p →link=s →link; s →link=p;7.设有一个二维数组A[m][n],假设A[0][0]存放位置在644(10),A[2][2]存放位置在676(10),每个元素占一个空间,问A[3][3](10)存放在什么位置?脚注(10)表示用10进制表示(B)。
A. 696B. 692C.688D. 6788.用某种排序方法对关键字序列(25,84,21,47,15,27,68,35,20)进行排序时,序列的变化情况如下:20,15,21,25,47,27,68,35,8415,20,21,25,35,27,47,68,8415,20,21,25,27,35,47,68,84则所采用的排序方法是(D )。
A.选择排序B.希尔排序C.归并排序D.快速排序9.组成数据的基本单位是(C )。
A. 数据项B.数据类型C.数据元素D.数据变量10.数组的逻辑结构不同于下列(A)的逻辑结构。
A. 树B. 栈C. 队列D. 线性表11.根据二叉树的定义可知二叉树共有(B)种不同的形态。
A.4B. 5C. 6D. 712.设一条单链表的头指针变量为head且该链表没有头结点,则其判空条件是(A )。
A. head==0B. head->next==0C. h ead->next==headD. head!=0 13.设用邻接矩阵A表示有向图G的存储结构,则有向图G中顶点i的入度为( B )。
A.第i行非0元素的个数之和B. 第i列非0元素的个数之和C.第i行0元素的个数之和D. 第i列0元素的个数之和14.设无向图G中有n个顶点,则该无向图的最小生成树上有(C)条边。
A. 2nB. 2n-1C. n-1D. n15.由权值分别为11,8,6,2,5的叶子结点生成一棵哈夫曼树,它的带权路径长度为(D)A. 24B. 48C. 53D. 71二、填空题(每空2分,共20分)1.数据的物理结构主要包括___顺序储存结构__和___链式存储结构_两种情况。
2.设某棵二叉树中度数为0的结点数为N 0,度数为1的结点数为N 1,则该二叉树中度数为2的结点数为_________;若采用二叉链表作为该二叉树的存储结构,则该二叉树中共有_______个空指针域。
3. 设顺序线性表中有n 个数据元素,则第i 个位置上插入一个数据元素需要移动表中_n-i+1__个数据元素;删除第i 个位置上的数据元素需要移动表中_n-i __个元素。
4.设某无向图G 的邻接表为,则从顶点V1开始的深度优先遍历序列为___V1V3V2V4_______ _;广度优先遍历序列为_V1V3V2V4 ____。
5. 设有一组初始关键字序列为(24,35,12,27,18,26),则第3趟直接插入排序结束后的结果的是______(12, 24, 27, 35, 18, 26)__ ________; 设有一组初始关键字序列为(24,35,12,27,18,26),则第3趟简单选择排序结束后的结果的是__(12, 18, 24, 27, 35, 26)_______。
三、判断题(对的划√,错的划×。
每小题1分,共10分)得分 评卷人得分 评卷人(×)1.线性表中的所有元素都有一个前驱元素和后继元素。
(√)2.不论是入队列操作还是入栈操作,在顺序存储结构上都需要考虑“溢出”情况。
(√)3.对连通图进行深度优先遍历可以访问到该图中的所有顶点。
(×)4.由树转化成二叉树,该二叉树的右子树不一定为空。
(√)5.如果某个有向图的邻接表中第i条单链表为空,则第i个顶点的出度为零。
(×)6..有向图的邻接表和逆邻接表中表结点的个数不一定相等。
//首先要明确建立“逆邻接表”的作用是为了方便计算入度.有向图每条弧对应唯一的弧头和弧尾.“逆邻接表”只是把“邻接表”中弧头和弧尾的次序换了,并不是一种新表,它和“邻接表”的唯一区别就是弧尾的nextarc指针指向弧头而已.所以节点数是相等的.(参考数据结构教材164页)(√)7.不论线性表采用顺序存储结构还是链式存储结构,删除值为X的结点的时间复杂度均为O(n)。
(×)8.关键路径是AOE网中源点到汇点的最短路径。
(√)9.图的深度优先遍历算法中需要设置一个标志数组,以便区分图中的每个顶点是否被访问过。
(×)10.用邻接矩阵作为图的存储结构时,则其所占用的存储空间与图中顶点数无关而与图中边数有关。
四、程序填空题(每个空2分,共10分)1.下面程序段的功能是实现一趟快速排序,请在下划线处填上正确的语句。
struct record {int key;datatype others;};void quickpass(struct record r[], int s, int t, int &i){ int j=t; struct record x=r[s]; i=s;while(i<j){while (i<j && r[j].key>x.key) j=j-1; if (i<j) {r[i]=r[j];i=i+1;}while (____________________) i=i+1; if (i<j) {r[j]=r[i];j=j-1;}}_________________;}2.如下为二分查找的非递归算法,试将其填写完整。
Int Binsch(ElemType A[ ],int n,KeyType K){int low=0;int high=n-1;while (low<=high){int mid=_______________________________;if (K==A[mid].key) return mid; //查找成功,返回元素的下标else if (K<[mid].key)_________________________; //在左子表上继续查找else __________________; //在右子表上继续查找}return -1; //查找失败,返回-1}五、分析简答题(第一题8分,其余各题6分,共20分)1.(8分)已知一个图的顶点集V和边集E分别为:V={1,2,3,4,5,6,7};E={(1,2)3,(1,3)5,(1,4)8,(2,5)10,(2,3)6,(3,4)15,(3,5)12,(3,6)9,(4,6)4,(4,7)20,(5,6)18,(6,7)25};用克鲁斯卡尔算法(Kruskal)得到最小生成树,试写出在最小生成树中依次得到的各条边。
(1,2)3--(4,6)4,--,(1,3)5,--(1,4)8,--(2,5)10--(4,7)20,2. (6分)设某棵二叉树的中序遍历序列为DBEAC,前序遍历序列为ABDEC,试写出这棵二叉树的后序遍历结果并画出这颗二叉树。
DEBCA3.(6分)一个线性表为B=(12,23,45,57,20,03,78,31,15,36),设散列表为HT[0..12],散列函数为H(key)= key % 13并用线性探查法解决冲突,请画出散列表,并计算等概率情况下查找成功的平均查找长度。
六、算法设计题(10分)设有一线性表(a1, a2,…,a n-1)用单链表存储,写算法实现将其就地逆置的操作。
(“就地”是指辅助空间应为O(1))。