高一第一学期期末复习 Microsoft Word 文档 (10)

高一第一学期期末复习 Microsoft Word 文档 (10)
高一第一学期期末复习 Microsoft Word 文档 (10)

高一第一学期期末课文复习

Unit 5

背出最后一段

1. the scene of the film 电影的情节on the scene = on the spot 在现场

the scents of animals the excellent sense of smell

the beautiful scenery of Hangzhou 杭州的美景

2. raise a folck of sheep raise one’s voice raise money raise questions

3. a new breed of dogs 品种,种类breed dogs

4. He sensed the danger. common sense 常识

make a sense = make senses 有意义make sense of 弄清楚

Can you make sense of what he said? 你能搞清楚他所说的话吗

There is no sense in doing ... 做…没理由

There is no need for sb to do sth 对某人来说没必要做…

5. tell sth apart 区别开

6. the sharp sense 敏锐的感觉 a sharp mind 敏捷的思维 a sharp knife

7. a couple of days 几天

8. be infected with 传染上…He is infected with a deadly disease.

9. be on stage 上演at this stage 在这个阶段

10. the symptom of the disease

11. shortly after = soon after 在…之后不久

12. work as man’s working partners

13. smell out enemies or track the scent of big animals

14. in a way = to some extent =to some degree 某种程度上

In a way, what you have said makes sense. 在一定程度上你的话是有道理的

15. keep sb company 陪伴某人

16. get over =overcome get over a lot of difficulties get over his shyness.

17. pass sth on to sb 把….传递给某人

We should pass on these good traditions from generation to generation.

18. guard against over-confidence 防止…发生

19. m an’s fou-legged friends 复合形容词只充当前置定语

20. give sb a real picture of…向…形象的描述了…

The book gives us a real picture of what happened at that time.

21. not only…but also He not only read the book, but also remembered what he read.

22. come to 逐渐的…终于…. He come to realize the danger of smoking.

23. share you life with it

24. rely on=depend on rely on sb to do sth rely on sb for sth

They relied on them to tell him the truth.

25. be covered with cover a distance of…cover an area of …

26. six month later

27. turn up 调高,出现

28. turn down one’s invitation 婉言拒绝turn to sb for help

29. in the depths of winter

30. prevent sb from doing sth ( stop…from…keep…from…)

We should take action to prevent the diease from spreding.

31. We remian good friends. He remains silent.

32. carry the disease

Unit 6 Cartoons and Comic Strips

背出第一及最后一段

1. attract / draw one's attention 吸引某人的注意力

2. punishment punish sb for (doing) sth punish sb by doing

He was punished for refusing to answer the question.

3. be lost in thought 陷于沉思中at the thought of 一想到

At the sight of his mother , he couldn’t help crying.

food for thought 引人深思的事物;需要认真考虑的事

4. be amused at/by sth/be amused to see, find, learn, hear…

5. a wide range of …很广的范围out of range 在范围外,在射程外

range from ... to ... 从…到… Their ages range from 9 to 50 years old.

6. an imaginary story 一个虚构的故事an imaginative boy 一个有想象力的男孩

7. have/feel sympathy for sb

8. popular reading materials be popular with/among

9. put...into words / express sth into words Sometimes it is hard to put what you think into words.

10.other than Nobody is here other than us. 这里除了我们之外没有别人。

rather than 而不是prefer to do A rather than do B

11. come into being = come into existence 出现,诞生

come into effect=come into force 开始生效

12. a set of 一套make a set 成为一套

set about doing sth=set out to do sth 着手去做… set sb free 释放某人

13. out of the question—— impossible 不可能Another trip abroad this year is out of the question.

out of question/without question 毫无疑问

14. for the moment / for the present / for the time being 暂时

at the moment / at present /now 现在,目前since then 自从那时起(常与现在完成时连用)

15. can’t help doing sth

16. people of all ages 各个年龄段的人people of all sorts people from all walks of life

17. bring sb to justice 将...绳之以法,让某人受到法律制裁

18. give way to 让位于= be replaced by 被...替代

The storm gave way to bright sunshine 阳光替代了暴风雨。

19. find / think / feel / make / consider it adj to do sth.

我们发现很难把我们的想法用言语表达出来。

We found it hard to put what we thought into words.

20. go hunting 去打猎hunt for a job 找工作= look for a job

21. means单复同型)Every means has been tried. All means have been tried.

by means of 通过… by all means 无论如何,务必by no means 决不

22. express one’s feeling表达某人的感情

23. at the same time It is time for us to take measures to prevent the disease from spreading.

for the first time, 第一次(时间点)the first time 第一次(连词,后接从句。)

24. deal with 应付,处理,和…相处,

We should learn to deal with various problems. 我们应当学会处理各种各样的问题。

The man is easy to deal with. 这个人很难相处。

25. in this aspect = in this respect 在这个方面

26. school report 成绩单

27. 2 out of 5 = 2 in 5

28. in a quite unusual way 以一种别出心裁的方法

29. fasten one’ s seat belt 系好安全带

30. He fell asleep while he was doing his English exercises. 当…时候

I am weak while he is strong. 然而

While I understand your viewpoint, I don’t agree with you.虽然

31. can’t help laughing at the cartoon laugh at sb / sth

32. a favorite pastime lively comic strips a few outstanding examples fancy animals

33. business-minded people 有商业头脑的人computer-made comics hand-drawn comics

34. with the improvement of … 随着… improve my spoken English.

With the improvement of the working conditions, workers can work more efficiently.

with the rise of with the help of with the development of

35. in the 1920s在20世纪90年代in one’s twenties在某人20多岁时

36. digital revolution 数字化革命

37. replace = take the place of 代替replace B with A用A替B

Unit 7

背出London的第二,三段

1. his prediction of the war predict sth predict that…

It is hard to predict what will happen tomorrow.

2. partly It was partly his fault. 有部分是他的错。

the financial and cultural centers of the world

4. quicken one’s pace slow one’s pace

keep pace with 跟上…步伐, 和…同步前进keep pace with the change of the times

5. be fascinated by a fascinating voice 迷人的嗓音 a fascinating story

6. a common sight in the street

7. public concern about heath 公众对于健康的忧虑

The Energy problem concerns us all. 能源问题与我们都有关。

be concerned about We are concerned about the energy problem.

9. change for the better变好

come true 实现(不及物) His dream of being a teacher has come true.

He has realized his dream of being a teacher.

as a city with a long history

12. regard…as 把…当…来看待(look on…as… think of…as… consider…as…)

be located in 位于……(be situated in) Our school is located in Nanxiang.

14. be known for… 由于……众所周知be known as… 作为……众所周知

Shanghai is known as an international metropolis.

15. air pollution 空气污染

16. traffic jam 交通阻塞

17. expect sb to do sth expect that…

18. go through 经历,经受= experience

Shanghai has gone through many changes.

20. The days are gone when…. …的日子一去不返了。

21. horse-drawn carriages 马车

24. the symbol of the city这个城市的象征

25. The second half of the 20th century saw great changes in the city.

★time + see ……: 发生,(见证了)

26. spring up 涌现出来Many new houses have sprung up here.

keep its heart

28. enjoy oneself = have a good time

29. the narrow street

30. lead to Hard work leads to success. This door leads to the gardon.

His carelessness led to this accident. 他的粗心导致了这场事故。

31. the busy traffic繁忙的交通the heavy traffic

Unit 8 Computers and the Internet

背出D,E二段

1. the focus of all the students

focus one’s attention on = concentrate on focus one’s efforts on 全力以赴去干…

focus one’s eyes on focus on 聚焦于,着重于

We should focus our attention on our studies.

The book focuses on the Chinese traditional customs.

2. communicate with sb 通讯交流communications technology space technology

3. lay a solid foundation for 为…打下坚实的基础

4. struggled with/against/for

5. raise a proposan put forward a proposal

6. browser n 浏览器browse v 浏览browse through 浏览

7. Please demonstrate how to operate the machine.

8. The machine doesn’t function properly the function of the machine

9. create many characters 创造许多人物 a creative studnet 有创造力的

10. simplify your explaination live a simple life

11. surf the net 在网上冲浪

12. do business online the online news

13. result in = lead to = bring about = cause = give rise to result from 由…所造成

His not working hard resulted in his failure. His failure resulted from his not working hard.

14. in search of 为了寻找…= to search for

search for 为了搜查search sb/sth 搜…

He surfed the net in search of the information that he needed. 他上网去搜寻他想要的信息。

15. up to date 现代的,新的out of date 过时的,落伍的

16. connect… with…连接The bridge connect the island with the mainland.

17. the research center 研究中心

18. allow sb to do sth 允许permit sb to do sth

19. exchange our opinions 交换观点

exchange A for B 用A换B in exchange for 作为…的交换

20. share resources 分享资源natural resources 自然资源

21. push sth forward 推动, 稳定的前进

22. electric 带电的electric current 电流electric light 电灯

electrical 和电有关的an electrical engineer 电气工程师

electronic mail

23. discuss sth with sb

24. user-friendly 对使用者来说是有利的eco-friendly 对生态有利的

25. graduate st udents 研究生graduate from

26. be pleasing to the eye 爽心悦目

27. point and click 点击

28. change our life style

29. cultural pattern 文化结构

30. the way of learning and doing research 学习和研究的方法

31. keep up to date on world events

32. enable sb to do sth Planes enable people to travel through the air.

The net enables people to gather a lot of information in a short time.

The net makes it possible for people to gather a lot of information in a short time.

An increasing number of people = more and more people

33. three hundred books 三百本书hundreds of thousands of books 成千上万本书

34. I own a shop. on one's own = by oneself of one's own

35. control n v 控制control this company

be in control = be under control在…控制下be out of control = beyond control

36. efficient adj 有效率的an efficient man

effecitve adj 有效的an effective way

37. the global village

38. have an influence on sb

数学模型习题解答解读

上机练习题一 班级: 姓名: 学号: 1.建立起始值=3,增量值=5.5,终止值=44的一维数组x 答案: x=(3:5.5:44) 2.写出计算 Sin(30o )的程序语句. 答案: sin(pi*30/180) 或 sin(pi/6) 3.矩阵??????????=187624323A ,矩阵???? ??????=333222111B ;分别求出B A ?及A 与B 中对应元素之间的乘积. 答案:A = [3,2,3; 4,2,6; 7,8,1] B = [1,1,1; 2,2,2; 3,3,3] A*B ;A.*B 4计算行列式的值1 876243 23=A 。答案:det(A) 5对矩阵 ???? ??????=187624323A 进行下述操作。 (1)求秩。答案:rank(A) (2)求转置。答案:A' (3) 对矩阵求逆,求伪逆。答案:inv(A) ,pinv(A) (4) 左右反转,上下反转。答案:fliplr(A),flipud(A) (5) 求矩阵的特征值. 答案:[u,v]=eig(A) (6) 取出上三角和下三角. 答案:triu(A) tril(A) (7)以A 为分块作一个3行2列的分块矩阵。答案:repmat(a) 6 计算矩阵??????????897473535与???? ??????638976242之和。 >> a=[5 3 5;3 7 4;7 9 8]; >> b=[2 4 2;6 7 9;8 3 6]; >> a+b 7 计算??????=572396a 与?? ????=864142b 的数组乘积。 >> a=[6 9 3;2 7 5]; >> b=[2 4 1;4 6 8];

【精选资料】VB控件 数组 过程复习题 参考答案2

常用标准控件作业 一、选择题 1.下列关于属性设置的叙述错误的是_______B__。 A.一个控件具有什么属性是Visual Basic预先设计好的,用户不能改变它 B.一个控件具有什么属性值是Visual Basic预先设计好的,用户不能改变它 C.一个控件的属性既可以在属性窗口中设置,也可以用程序代码设置 D.一个控件的属性在属性窗口中设置后,还可以再利用程序代码为其设置新值 2.以下过程是标签Label1的___A______事件。 Prviate Sub Label1_Click( ) End Sub A.单击 B.双击 C.拖拽 D.移动 3.下列控件中可设置滚动条是____C_____。 A.检查框(复选框) B.框架 C.文本框 D.标签框 4.标签所显示的内容,由___C______属性值决定。 A. Text B. Name C. Caption D. Alignment 5.定时器的定时间隔单位是__C_______。 A. 秒 B. 微秒 C. 毫秒 D. 分 6.检查框(复选框)的控件名称为______B___。 A. OptionBotton B. CheckBox C. PictureBox D. Image 7.若要求向文本框输入密码时,只在文本框中显示&号,则应当在此文本框的属性窗口中设置______D___。 A. Text属性值为& B. Caption属性值为& C. PasswordChar属性值为空 D. PasswordChar属性值为& 8.若要设置定时器的定时间隔,可通过__A_______属性来设置。 A. Interval B. Value C. Enabled D. Text 9.若要设置定时器的定时间隔设为5秒,应将Interval属性值设为_D________。 A. 5 B. 50 C. 500 D. 5000 10.若要使不可见命令按钮显示出来,可通过设置_____A____属性的值为True来实现。 A.Visible B.Enabled C.Default D.Value 11.若要使定时器起作用,应将其__D_______属性设置值设为True。 A.Interval B.Value C.Text D.Enabled 12.若要使命令按钮失效,可设置_____B____属性为False来实现。 A.Value B.Enabled C.Visible D.Cancel 13.若要向列表框新增列表项,可使用_____D____方法来实现。 A.Add B.RemoveItem C.Clear D.AddItem 14.要获得垂直滚动条Vscrollbar控件所能表示的最大值,可通过调用该控件的_____B____属性来实现。 A.Value B.Max C.Min https://www.360docs.net/doc/db16906445.html,rgeChange 15.要将命令按钮上的文字设置为“粗体”可通过设置__B_______属性值为True来实现。 A.FontItalic B.FontBold C.FontUnderline D.FontSize 16.要将命令按钮上的文字设置为“斜体”可通过设置____A_____属性值为True来实现。 A.FontItalic B.FontBold C.FontUnderline D.FontSize 17.要将命令按钮上的字体设为“隶书”,可设置______C___的属性为“隶书”。 A.FontBold B.BackItalic C.FontName D.FontSize 18.以下选项中,不属于单选按钮属性的是____D_____ A.Enabled B.Caption https://www.360docs.net/doc/db16906445.html, D.Min 19.组合框的风格可通过____C_____属性来设置。 A.BackStyle B.BorderStyle C.Style D.Sorted 20.标签的边框由_____C____属性的设置来决定。 A.BackColor B.BackStyle C.BorderStyle D.AutoSize 21.单选按钮的控件名称为____D_____。 A.Botton B.CheckBox C.PictureBox D.OptionBotton 22.单选按钮的当前状态可通过___A______属性来访问。 A.Value B.Checked C.Selected D.Caption 23.当滚动条中的滑块位置变化时,将触发其___C______事件。 A.LostFocus B.SetFocus C.Change D.GetFocus 24.假定Picture1和Form1分别为图片框和窗体的名称,以下语句___A______可清除图片框中的文本信息。 A.Picture1.cls B.Picture1.clear C.Form1.cls D.Form1.clear 25.确定一个窗体或控件的大小的属性是_____B____。 A.Width或Height B.Width和Height C.Top或Left D.Top和Left

-+串数组树作业(参考答案)

第四-六章串、数组、树作业 一、判断正误:(每小题1分,共5分) 正确在()内打√,否则打× . 1.(√)子串是主串中任意个连续字符组成的序列. 2.(×)线性结构只能用顺序结构存放,非线性结构只能用链表存放. 3.(√)完全二叉树的某结点若无左孩子,则它必是叶结点. 4.(√)二叉树有五种基本形态. 5. (√)由树的中序表示和前序表示可以导出树的后序表示. 6. (√)将一棵树转换为二叉树表示后,该二叉树的根结点没有右子树. 7. (√)采用二叉树来表示树时,树的先根次序遍历结果与其对应的二叉树的前序遍历结果是一样的. 8. (×)在Huffman树中,权值较大的叶子结点离根较远. 9. (×)用一维数组存储二叉树时,是以先根遍历的次序存储结点. 二、填空题 1.已知二维数组A[0..10][0..20]采用行序为主方式存储,每个元素占2个存储单元, 并且A[0][0]的存储地址是1024, 则A[6][18]的地址是1312(1024+2*(6*21+18)) . 2. 深度为5的二叉树最多有_____31___个结点(根结点层数为1). 3.高度为h的完全二叉树最少有2h-1个结点. 4. 二叉树的先序遍历序列为:EFHIGJK,中序遍历序列为:HFIEJKG,则该二叉树根的右子树的根是:G . 5. N个结点的二叉树,采用二叉链表存放,空链域的个数为N+1 . 6. 填空完成下面中序遍历二叉树的非递归算法: void InOrder(BiTree root) { InitStack ( &S ); p = ____root_____ ; while ( _____p________ || ! IsEmpty(S)) { while (p!=NULL) { Push(&S, __p___ ) ; p = _____p->lchild_________ ; } if ( ____! IsEmpty(S)___________ ) { Pop(&S, __p_____ ) ; Visit ( p -> data ); p = ___p->rchild____________ ; } } } 三、选择题 1.表达式a*(b?c)+d的后缀表达式是( B). A)abcd*?+ B)abc?*d+ C)abc*?d+ D)+?*abcd 2.对于有N个结点高度为K的满二叉树(结点编号为1到N,根结点的层数为1),其第K 层上最后1个结点的编号为 ( D ). A)2K B)2K?1 C)B)2K?1?1 D)2K?1 3.将一棵有100个结点的完全二叉树从根这一层开始,每一层从左到右依次对结点 进行编号,根结点编号为1,则编号最大的非叶结点的编号为:( C ) . A)48 B)49 C)50 D)51 4.在下列存储形式中,哪一个不是树的存储形式?( D ) . A)双亲表示法 B)孩子链表表示法 C)孩子兄弟表示法 D)顺序存储表示法

一维数组练习题

一维数组练习题 1、以下对一维数组a进行正确初始化的是__________。 A) int a[10]=(0,0,0,0,0); B) int a[10]={ }; C) int a[ ]={0}; D) int a[10]={ 10*2}; 2、以下一维数组a的正确定义是________ 。 A) int a(10); B) int n=10,a[n]; C) int n; D) #define SIZE 10 scanf("%d",&n); int a[SIZE]; int a[n]; 3、执行下面的程序段后,变量k中的值为__________。 int k=3,s[2]; s[0]=k; k=s[1]*10; A) 不定值B) 33 C) 30 D) 10 4、下列程序执行后的输出结果是__________。 main() {int a,b[5]; a=0; b[0]=3; printf("%d,%d\n",b[0],b[1]); } A) 3,0 B) 3 0 C) 0,3 D) 3,不定值 5、已知数组a的赋值情况如下所示,则执行语句a[2]++;后a[1]和a[2]的值 分别是________。 a[0] a[1] a[2] a[3] a[4] ┌──┬──┬──┬──┬──┐ │ 10 │ 20 │ 30 │ 40 │ 50 │ └──┴──┴──┴──┴──┘ A) 20和30 B) 20和31 C) 21和30 D) 21和31 6、以下程序输出a数组中的最小值及其下标,在划线处应填入的是________。main( ) { int i,p=0,a[10]; for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=1;i<10;i++) if(a[i]

Java基础作业详解及答案

Java基础语句作业详解及答案 1.编写程序,用数组实现乘法小九九的存储和输出。【提示:采用多个一维数组。】 public class Multipation { public static void main(String[] args) { // TODO Auto-generated method stub int x[][]=new int[9][9]; for(int i=0;i<9;i++){ for(int j=0;j<9;j++){ if(i>=j){ int m=i+1; int n=j+1; x[i][j]=m*n; System.out.print(m+"*"+n+"="+x[i][j]); } } System.out.println(); } } }

2. 定义一个类Student,属性为学号、姓名和成绩;方法为增加记录SetRecord和得到记录GetRecord。SetRecord给出学号、姓名和成绩的赋值,GetRecord通过学号得到考生的成绩。public class Student { /** *@param args */ private int ID; private String name; private float score; public void SetRecord(int ID,String name,float score){ this.ID=ID; https://www.360docs.net/doc/db16906445.html,=name; this.score=score; } public float getRecord(int ID){ if(ID==this.ID) return this.score; else return -1; } public static void main(String[] args) { // TODO Auto-generated method stub Student s=new Student(); s.SetRecord(0,"alex",100); float Sco=s.getRecord(0); System.out.print(Sco); } }

一维数组习题

一维数组 【例1】输入50个数,要求程序按输入时的逆序把这50个数打印出来;也就是说,请你按输入相反顺序打印这50个数 分析:我们可定义一个数组a用以存放输入的50个数,然后将数组a内容逆序输出,源程序如下 program ex5_1; type arr=array[1..50]of integer; {说明一数组类型arr} var a:arr; i:integer; begin writeln('Enter 50 integer:'); for i:=1 to 50 do read(a[i]);{从键盘上输入50个整数} readln; for i:=50 downto 1 do {逆序输出这50个数} write(a[i]:10); end. 【例2】输入十个正整数,把这十个数按由大到小的顺序排列(将数据按一定顺序排列称为排序,排序的算法有很多,其中选择排序中的―简单选择排序‖是一种较简单的方法) 分析:要把十个数按从大到小顺序排列,则排完后,第一个数最大,第二个数次大,……;因此,我们第一步可将第一个数与其后的各个数依次比较,若发现,比它大的,则与之交换,比较结束后,则第一个数已是最大的数。同理,第二步,将第二个数与其后各个数再依次比较,又可得出次大的数。如此方法进行比较,最后一次,将第九个数与第十个数比较,以决定次小的数。于是十个数的顺序排列结束。 例如下面对5个进行排序,这个五个数分别为829105。按选择排序方法,过程如下: 初始数据:82910 5 第一轮排序:82910 5 92810 5 10289 5 10289 5 第二轮排序:10829 5 10928 5 10928 5 第三轮排序:10982 5 10982 5 第四轮排序:10985 2 对于十个数,则排序要进行9次。源程序如下: program ex5_2; var a:array[1..10]of integer; i,j,t:integer; begin writeln('Input 10 integers:'); for i:=1 to 10 do read(a[i]);{读入10个初始数据} readln; for i:=1 to 9 do{进行9次排序} begin for j:=i+1 to 10 do{将第i个数与其后所有数比较}

一维数组练习题

维数组练习题1 、以下对一维数组 a 进行正确初始化的是 ____________ A) int a[10]=(0,0,0,0,0); C) int a[ ]={0}; B) int a[10]={ }; D) int a[10]={ 10*2}; 2 、以下一维数组 a 的正确定义是_________ 。 A) int a(10); B) int n=10,a[n]; C) int n; D) #define SIZE 10 scanf("%d",&n); int a[SIZE]; int a[n]; 3 、执行下面的程序段后 , 变量 k 中的值为 __________ 。 int k=3,s[2]; s[0]=k; k=s[1]*10; A) 不定值B) 33 C) 30 D) 10 4 、下列程序执行后的输出结果是 main() {int a,b[5]; a=0; b[0]=3; printf("%d,%d\n",b[0],b[1] ); A) 3,0 C) 0,3 } B) 3 0 D) 3, 不定值 5、已知数组a的赋值情况如下所示,则执行语句a[2]++; 后a[1]和a[2]的值分别是_______________ 。 a[0] a[1] a[2] a[3] a[4] 10 | 20 | 30 | 40 | 50 | A) 20 和 30 C) 21 和 30 B) 20 和 31 D) 21 和 31 6、以下程序输出 a 数组中的最小值及其下标,在划线处应填入的是 _____________ main( ) { int i,p=0,a[10]; for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=1;i<10;i++) if(a[i]

Java数组练习题(带答案)

一填空题 1)数组的元素通过下标来访问,数组Array的长度为Array.length 。 2)数组复制时,"="将一个数组的引用传递给另一个数组。 3)JVM将数组存储在栈(堆或栈)中。 4)数组的二分查找法运用的前提条件是数组已经排序。 5)Java中数组的下标的数据类型是整型。 6)数组最小的下标是0 。 7)arraycopy()的最后一个参数指明复制元素的个数。 8)向方法传递数组参数时,传递的是数组的引用。 9)数组初始化包括数组的申明,创建和初始化。 10)数组下标访问超出索引范围时抛出数组越界异常 11)浮点型数组的默认值是0.0f 。 12)数组创建后其大小不能改变。 二选择题 1.下面错误的初始化语句是_ABD__ A. char str[]="hello"; B. char str[100]="hello"; C. char str[]={'h','e','l','l','o'}; D. char str[]={'hello'}; 2.定义了一维int型数组a[10]后,下面错误的引用是_B__ A. a[0]=1; B. a[10]=2; C. a[0]=5*2; D. a[1]=a[2]*a[0]; 3.下面的二维数组初始化语句中,正确的是____ A. float b[2][2]={0.1,0.2,0.3,0.4}; B. int a[][]={{1,2},{3,4}}; C. int a[2][]= {{1,2},{3,4}}; D. float a[2][2]={0}; 4.引用数组元素时,数组下标可以是_D___ A. 整型常量 B. 整型变量 C. 整型表达式 D. 以上均可 5.定义了int型二维数组a[6][7]后,数组元素a[3][4]前的数组元素个数为____ A. 24 B. 25 C. 18 D. 17 6.下列初始化字符数组的语句中,正确的是__B__ A. char str[5]="hello"; B. char str[]={'h','e','l','l','o','\0'}; C. char str[5]={"hi"}; D. char str[100]=""; 7.数组在Java中储存在 C 中 A. 栈 B. 队列 C. 堆 D. 链表 8.下面程序的运行结果是____ main() { int a[][]={{1,2,3},{4,5,6}}; System.out.printf("%d", a[1][1]); } A. 3 B. 4 C. 5 D. 6 9.下面程序的运行结果是_C___ main() {

第二章数组习题解答

第二章数组部分习题解答 2-1 设n个人围坐在一个圆桌周围,现在从第s个人开始报数,数到第m个人,让他出局;然后从出局的下一个人重新开始报数,数到第m个人,再让他出局,……,如此反复直到所有的人全部出局为止。下面要解决的Josephus问题是:对于任意给定的n, s和m,求出这n个人的出局序列。请以n = 9, s = 1, m = 5为例,人工模拟Josephus的求解过程以求得问题的解。 【解答】 出局人的顺序为5, 1, 7, 4, 3, 6, 9, 2, 8。 2-2 试编写一个求解Josephus问题的函数。用整数序列1, 2, 3, ……, n表示顺序围坐在圆桌周围的人,并采用数组表示作为求解过程中使用的数据结构。然后使用n = 9, s = 1, m = 5,以及n = 9, s = 1, m = 0,或者n = 9, s = 1, m = 10作为输入数据,检查你的程序的正确性和健壮性。最后分析所完成算法的时间复杂度。 【解答】函数源程序清单如下: void Josephus( int A[ ], int n, s, m ) { int i, j, k, tmp; if ( m== 0 ) { cout << "m = 0是无效的参数!" << endl; return; } for ( i = 0;i < n;i++ ) A[i] = i + 1;/*初始化,执行n次*/ i = s- 1;/*报名起始位置*/ for ( k = n;k > 1;i-- ) {/*逐个出局,执行n-1次*/ if ( i ==k ) i = 0; i = ( i + m- 1 ) % k;/*寻找出局位置*/ if ( i != k-1 ) { tmp = A[i]; /*出局者交换到第k-1位置*/ for ( j = i;j < k-1;j++ ) A[j] = A[j+1]; A[k-1] = tmp; } } for ( k = 0;k < n / 2;k++ ) {/*全部逆置, 得到出局序列*/ tmp = A[k];A[k] = A[n-k+1];A[n-k+1] = tmp; } } 例:n = 9, s = 1, m = 5 第5人出局, i = 4 第1人出局, i = 0

数据结构作业答案

数据结构作业答案

第一章 单选题 1、下列关于算法的基本特征,说法不正确的是()。能行性是算法中的每一个步骤必须能够实现且能达到预期的目的。算法的确定性是指算法中的每一个步骤必须是有明确的定义,不允许模棱两可。 算法的有穷性是指算法必须能在有限的时间内做完。算法与提供情报无关。 [D] 教师批改:D 2、算法的时间复杂度取决于()。问题的规模待处理的数据的初态 问题的难度 A 和 B [D] 教师批改:D 3、下列选项中,不是算法基本特征的是()。可行性有穷性 确定性高效率 [D] 教师批改:D 4、通常一个好的算法应达到的目标中,不包括()。正确性可读性 技巧性健壮性 [C] 教师批改:C

5、在一般的计算机系统中,基本的运算和操作不包括()。语法处理算术运算 关系运算数据传输 [A] 教师批改:A 6、工程上常用的分治法是()。列举法归纳法 减半递推技术回溯法 [C] 教师批改:C 多选题 7、算法设计的要求包括()。 正确性可读性 健壮性唯一性 [ABC] 教师批改:A,B,C 8、算法的时间复杂度应该与()无关。 所使用的计算机程序设计语言 基本运算的执行次数程序编制者 [ABD] 教师批改:A,B,D 9、下列关于算法的描述中,不正确的有()。算法即是计算机程序算法是解决问题的计算方法 算法是排序方法算法是解决问题的有限运算序列

[ABC] 教师批改:A,B,C 填空题 16、所谓算法是指()。 教师批改:解题方案的准确而完整的描述 17、算法的基本特征有()、()、()和() 教师批改:能行性、确定性、有穷性和拥有足够的情报。 18、一个算法通常由两种基本要素组成,它们是()和()。 教师批改:算法中对数据的运算和操作。 算法的控制结构。 19、工程上常用的几种算法设计方法有列举法、()、()、()、()和回溯法。 教师批改:归纳法、递推、递归、减半递推技术。 20、算法的复杂度主要包括()复杂度和()复杂度。 教师批改:时间、空间 综合题 21、设给定3个整数a,b,c,试写出寻找这3个整数的中数的算法;并分析在平均情况与最坏

数组广义表答案及二叉树习题及答案

栈、队列、串、数组和广义表习题 一、选择题 1 一个栈的输入序列为1 2 3 4 5,则下列序列中不可能是栈的输出序列的是( B )。 A. 2 3 4 1 5 B. 5 4 1 3 2 C. 2 3 1 4 5 D. 1 5 4 3 2 2若已知一个栈的入栈序列是1,2,3,…,n,其输出序列为p1,p2,p3,…,p N,若p N是n,则p i是( D )。 A. i B. n-i C. n-i+1 D. 不确定 3 若用一个大小为6的数组来实现循环队列,且当前rear和front的值分别为0和3,当从队列中删除一个元素,再加入两个元素后,rear和front的值分别为多少?( B ) A. 1和 5 B. 2和4 C. 4和2 D. 5和1 4 设栈S和队列Q的初始状态为空,元素e1,e2,e3,e4,e5和e6依次通过栈S,一个元素出栈后即进队列Q,若6个元素出队的序列是e2,e4,e3,e6,e5,e1则栈S的容量至少应该是( C )。 A. 6 B. 4 C. 3 D. 2 5 设有两个串p和q,其中q是p的子串,求q在p中首次出现的位置的算法称为( C ) A.求子串 B.联接 C.匹配 D.求串长 6 设有一个10阶的对称矩阵A,采用压缩存储方式,以行序为主存储,a11为第一元素,其存储地址为1,每个元素占一个地址空间,则a85的地址为( B )。 A. 13 B. 33 C. 18 D. 40 7 已知广义表LS=((a,b,c),(d,e,f)),运用head和tail函数取出LS中原子e的运算是( C )。 A. head(tail(LS)) B. tail(head(LS)) C. head(tail(head(tail(LS))) D. head(tail(tail(head(LS)))) 8 模式串t=‘abcaabbcabcaabdab’,该模式串的next数组的值为( D ),nextval数组的值为( F )。 A.0 1 1 1 2 2 1 1 1 2 3 4 5 6 7 1 2 B.0 1 1 1 2 1 2 1 1 2 3 4 5 6 1 1 2 C.0 1 1 1 0 0 1 3 1 0 1 1 0 0 7 0 1 D.0 1 1 1 2 2 3 1 1 2 3 4 5 6 7 1 2 E.0 1 1 0 0 1 1 1 0 1 1 0 0 1 7 0 1 F.0 1 1 0 2 1 3 1 0 1 1 0 2 1 7 0 1 二、填空题 1 在作进栈运算时应先判别栈是否_(1)满_;在作退栈运算时应先判别栈是否_(2)空_;当栈中元素为n个,作进栈运算时发生上溢,则说明该栈的最大容量为_(3)n_。 2 设循环队列存放在向量sq.data[0:M]中,则队头指针sq.front在循环意义下的出队操作可表示为__return(sq.data(sq.front));sq.front=(sq.front+1)%(M+1);_____,若用牺牲一个单元的办法来区分队满和队空(设队尾指针sq.rear),则队满的条件为_(sq.rear+1)%(M+1)==sq.front;_。 3 串是一种特殊的线性表,其特殊性表现在__(1) 其数据元素都是字符__;串的两种最基本的存储方式是__(2) 顺序存储__、__(3) 和链式存储__;两个串相等的充分必要条件

实验6数组——参考答案

实验6 数组 一、一维数组实验 2. 编程:输入长度为10的整型数组并输出;然后将其逆序存放后再输出。例如: Input 10 number: 0 1 2 3 4 5 6 7 8 9 After reversed: 9 8 7 6 5 4 3 2 1 0 #include<> void main() { int i, j, a[10], t; printf("Input 10 number: "); for(i=0; i<10; i++) /*读入数据*/ scanf("%d", &a[i]); printf("origin data: "); for(i=0; i<10; i++) /*输出原始数据*/ printf("%d ", a[i]); printf("\n"); for(i=0,j=9; i

#include <> void main() { int i, n , max, min, a[10], sum; float average; printf("Input n (1 a[max]) max= i; if(a[i] < a[min]) min= i; } printf("max=%-5d index=%d\n", a[max], max); printf("min=%-5d index=%d\n", a[min], min); printf("average=%.2f\n", average); } else printf("数据超出范围"); } 4. 编程:青年歌手参加歌曲大奖赛,有10个评委对她(他)进行打分,试编程求这位选手的平均得分并输出(去掉一个最高分和一个最低分)。 #include <> void main() { int i, max, min; float a[10], ave; printf("请输入10个评委的打分:"); for(i=0, ave=0; i<10; i++) /*输入分数并求累加和*/ {

程序设计C作业三有答案

第3次作业答案(红字为答案) 1. 下列叙述中错误的是() A. 对于double 类型数组,不可直接用数组名对数组进行整体输入或输出 B. 数组名代表数组所占存储区的首地址,其值不可变 C. 在程序执行过程中,当数组元素下标超出定义的下标范围时,系统将给出“下标”越界的错误提示 D. 可以通过赋初值的方式确定数组元素个数 提示:请从数组下标的合法取值范围来考虑。 2. 已有定义char a[] = “xyz”,b[]={‘x’, ‘y’, ‘z’} ,以下叙述正确的是() A. 数组a 和b 的长度相同 B. 数组a 的长度小于数组b 的长度 C. 数组a 的长度大于数组b 的长度 D. 上述说法均不正确 提示:此题考察字符数组长度和字符串长度之间的关系。 3. 以下能正确定义一维数组的选项是() A. int num[]; B. #define N 100 int num[N] C. int num[0..100]; D. int N = 100; int num[N]; 提示:此题考察一维数组的维数界定问题。 4. 下列程序的输出结果是() #include void main() { char a[] = {‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘\0’}; int i, j; i = sizeof(a); j = strlen(a); printf(“%d, %d\n”, i, j); } A. 9,9 B. 8, 9 C. 1, 8 D. 9,8 提示:此题考察字符数组长度和字符串长度之间的关系。 5. 以下不能正确定义二维数组的选项是() A. int a[2][] = {{1, 2}, {3, 4}}; B. int a[][2] = {1, 2, 3, 4}; C. int a[2][2] = {{1}, {2}}; D. int a[2][2] = {{1}, 2, 3}; 提示:此题考察二维数组初始化的规定。 6、C 语言规定,若未对函数返回类型加以说明,则函数的隐含类型为() A. void B. double C. int D. char 分析:教材中有答案,但我们不推荐大家在编程时省略函数返回类型。 7、若已定义的函数有返回值,则以下关于该函数调用的叙述错误的是() A. 函数调用可以作为独立语句存在 B. 函数调用可以作为一个函数的实参 C. 函数调用可以出现在表达式中 D. 函数调用可以作为左值而被赋值 分析:基本概念题,可查书或上机验证。 8、下列说法中错误的是() A. 在不同的函数中可以使用相同名字的变量 B. 函数中的形参是局部变量 C. 在一个函数内定义的变量只在本函数范围内有效

C-数组上机作业和参考答案

实 验 报 告 五 一【实验目的】 1.掌握一维数组、二维数组的概念及元素的各种表示方法 2.正确掌握数组输入输出等的基本操作。 3.掌握数组和指针的关系和有关操作 4.掌握数组掌握字符串的处理方法 5.掌握数组中的一些常用算法。 二【实验内容】 【实验5-1】从键盘输入6个同学计算机课程期末考试成绩,并统计出平均分、最高分、最低分,以及统计超过平均分的人数,并实现正确输出。 【实验5-2】随机产生10个学生的计算机课程的成绩(30~100),按照从大到小的顺序排序,分别显示排序前和排序后的结果。 提示:#include,包含实用工具函数后,可以使用随机函数产生成绩如: for(i=0;i<10;i++) score[i]=rand ( )%71+30; [真题17套] 请编写程序实现功能:把s 所指字符串中的内容逆置。例如:字符串中原有的字符串为:abcdefg ,则执行后, 串s 中的内容为:gfedcba 。 [真题10套] 请编写程序实现,将s 所指字符串中下标为偶数的字符删除,串中剩余字符形成的新串放在t 所指数组中。例如,当s 所指字符串中的内容为:"ABCDEFGHIJK",在t 所指数组中的内容应是:"BDFHJ"。 [真题13套]请编写程序实现功能:使数组左下三角元素中的值乘以n 。例如:若n 的值为3,a 数组中的值为????? ? ?65 4832791则返回主程序后a 数组中的值为?? ?? ? ??181512896793 [真题58、76套]请编写程序实现功能:求出一个2×4整型二维数组中最大元素的值,并将此值 输出。(int arr[2][4]={5,8,3,45,76,-4,12,82} ;) [真题65套] 请编写程序实现功能: 求出二维数组周边元素之和并输出。 6107 5 3 189******** 97531则函数值为为例如:二维数组中的值???? ?? ? ? ? [真题67套] 编写程序, 实现矩阵(3行3列)的转置(即行列互换)

C作业答案

1.在C语言中,复合语句要用一对()括起来。 A.方括号 B.圆括号 C.大括号 D.尖括号 [提示]参考讲稿3.1.1-4 2. C语言中,下面哪项是不合法的标识符?() A. user B. switch C. _345 D. Abc [提示]参考讲稿2.1.1 3.以下说法中正确的是() A. C语言比其他语言高级 B. C语言不用编译就能被计算机执行 C. C语言以接近英语国家的自然语言和数学语言作为语言的表达形式 D. C语言出现的最晚,具有其他语言的一切优点 [提示]这个留给自己发挥吧,你觉得不用翻书考证就能看出来的就是答案啦 4.若变量x、y已正确定义并赋值,以下符合C语言语法规则的语句是() A. ++x, y = x--; B. x + 1 = y; C. x = x + 10 = x + y; D. double(x)/10 [提示]自己编个小程序,包含上述语句,然后编译一下,编译器报错的地方就是不对的。以后涉及程序、程序段、语句、表达式的题目都可以这样做。 5.下列程序的输出结果为() void main()

{ int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d, %d\n”, x, y, z); } A.2, 3, 3 B. 2, 3, 2 C. 2, 3, 1 D. 2, 2, 1 [提示]这个不用提示吧,上机运行一下就知道了。程序设计课要动手,干看是学不会的哟。 6.数值029是一个() A.八进制数 B.十六进制 C.十进制 D.非法数 [提示]参考讲稿2.2.2 7.逻辑运算符两侧运算对象的数据类型() A.只能是0或1 B.只能是0或非0正数 C.可以是整型或字符型数据 D.可以是任何类型的数据 [提示]自己编个小程序,写几个逻辑表达式,将C语言中所有的数据类型都放到逻辑表达式中试一试。8.对于int a,表达式1 <= a <= 5的值是() A. 0B. 1C.不定D.表达式语法有误 [提示]自己编个小程序,…… 9.执行下列语句段后x的值为() int a = 14, b = 15, x; char c = ‘A’;

实验5数组 习题及答案

实验5 数组 班级:学号: 姓名:日期: 一、实验目的 (1)掌握一维数组和二维数组的定义、赋值和输入输出方法; (2)掌握字符数组和字符串函数的使用; (3)掌握与数组有关的算法(特别是排序算法)。 二、实验内容 1.阅读下面程序,写出程序运行结果,并且上机进行验证。 (1) #include "stdio.h" void main() { int i,n[4]={0,0,0,0}; for(i=1;i<4;i++) { if (i==3) break; n[i]=n[i-1]+1; } printf("n[i-1]=%d n[i]=%d\n",n[i-1],n[i]); } (2)#include "stdio.h" void main() { char ch[]={'0','1','2','3','4','5','6','7','8','9'}; int i=0,m=2,r,x=42; char b[80]; while(x) { r=x%m; x/=m; b[i++]=ch[r]; } for(--i;i>=0;i--) printf("%c",b[i]);

printf("\n"); } (3)#include "stdio.h" void main() { int a[][3]={9,7,5,3,1,2,4,6,8}; int i,j,s1=0,s2=0; for(i=0;i<3;i++) for(j=0;j<3;j++) { if(i==j) s1=s1+a[i][j]; if(i+j==2) s2=s2+a[i][j]; } printf("s1=%d s2=%d",s1,s2); } (4)#include "stdio.h" void main() { int r[5]={1,2,3,4,5}; int i,j,a[5][5]; for(i=0;i<=4;i++) { for(j=i;j<=4;j++) a[i][j]=r[j-i]; for(j=0;j

书面作业_7-参考答案

书面作业_7 请按下列要求,编写相应程序: 1、一个10个整数的数组(34,91,83,56,29,93,56,12,88,72),找出最小值和其下标。 参考答案: #include void main() { int a[] = {34,91,83,56,29,93,56,12,88,72}; int i; int imin, min; min=a[0]; //记录找到的最小值 imin=0; //最小值的下标 for(i=1; i<10; i++) { if(a[i]

2、用rand()函数产生100000个0-9之间的随机整数,分别统计0-9数字出现的次数,并输出对应的百分比。(提示:统计次数用一维数组来存放) 参考答案: #include #include //rand()函数在这个头文件中 void main() { int x; //生成的随机数 int y[10] = {0}; //记录每个数字出现的次数 int i; for(i=0; i<100000; i++) { x = rand(); x = x%10; y[x]++; } for(i=0; i<10; i++) { printf("%d -> %lf\n", i, y[i]/100000.0); } }

3、将数组中的数按颠倒的顺序重新存放。在操作时,只能借助一个临时存储单元而不得另外开辟数组。 注意:不是要求按颠倒的顺序打印数据,而是要求按逆序重新放置数组中的内容。假定a数组有8个元素,原始内容如表-1所示: 表-1 数组a原来的内容 现要求改变成如表-2所示: 表-2 重新排列后的数组a 参考答案: #include void main() { int a[8] = {10,22,31,46,53,67,73,89}; int t; //临时变量 int i; int Count; //a的元素个数 Count = sizeof(a)/sizeof(a[0]); for(i=0; i

相关文档
最新文档