Assignment31.docx

上传人:b****3 文档编号:4677672 上传时间:2022-12-07 格式:DOCX 页数:12 大小:20.30KB
下载 相关 举报
Assignment31.docx_第1页
第1页 / 共12页
Assignment31.docx_第2页
第2页 / 共12页
Assignment31.docx_第3页
第3页 / 共12页
Assignment31.docx_第4页
第4页 / 共12页
Assignment31.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

Assignment31.docx

《Assignment31.docx》由会员分享,可在线阅读,更多相关《Assignment31.docx(12页珍藏版)》请在冰豆网上搜索。

Assignment31.docx

Assignment31

Chapter5.Algorithms

第五章。

算法

MultipleChoiceQuestions

多项选择题

1.Whichofthefollowingisanactivity?

1。

下列哪一项是活动吗?

A.AlgorithmB.ProgramC.Process

abc算法程序过程

2.Whichofthefollowingisnotameansofrepeatingablockofinstructions?

2。

下列哪一项不是意味着重复的一块指令?

A.PretestloopB.PosttestloopC.RecursionD.Assignmentstatement

abc预发循环后续测试循环递归d.赋值语句

3.Whensearchingwithinthelist:

Lewis,Maurice,Nathan,Oliver,Pat,Quincy,Roger,Stan,Tom,whichofthefollowingentrieswillbefoundmostquicklyusingthesequentialsearchalgorithm?

3。

当搜索列表中的:

路易斯,莫里斯,内森,奥利弗,帕特,昆西,罗杰,斯坦,汤姆,下列哪项将发现大多数迅速使用顺序搜索算法?

A.LewisB.PatC.Tom

a·路易斯b.patc.汤姆

4.Whensearchingwithinthelist:

Lewis,Maurice,Nathan,Oliver,Pat,Quincy,Roger,Stan,Tom,whichofthefollowingentrieswillbefoundmostquicklyusingthebinarysearchalgorithm?

4。

当搜索列表中的:

路易斯,莫里斯,内森,奥利弗,帕特,昆西,罗杰,斯坦,汤姆,下列哪项将发现大多数快速使用的二进制搜索算法?

A.LewisB.PatC.Tom

a·路易斯b.patc.汤姆

5.IfXisinteger,whichofthefollowingistheterminationconditionforthefollowingloop?

5。

如果X是整数,下面哪个是终止条件下面的循环吗?

while(X<5)do(...)

虽然(X<5)做(。

)。

A.X<5B.X>4C.X<4

a.X<5b.X>4c.X<4

6IfXisinteger,whichofthefollowingistheterminationconditionforthefollowingloop?

6如果X是整数,下面哪个是终止条件下面的循环吗?

repeat(...)until(X<5)

重复(。

)。

直到(X<5)

A.X<5B.X>4C.X>5

a.X<5b.X>4c.X>5

7.IfNisinteger,whichofthefollowingistheterminationconditioninthefollowingrecursiveprocedure?

7。

如果N是整数,下面哪个是终止条件在接下来的递归程序吗?

procedurexxx(N)

程序xxx(N)

if(N<5)then(applytheprocedurexxxtothevalueN+1)

如果(N<5)然后(应用程序xxx值N+1)

else(printthevalueofN)

其他(打印N值)

A.N<5B.N>4C.N<4

a.N<5b.N>4c.N<4

8Whichofthefollowingdoesnotprintthesamesequenceofnumbersastheothers?

8以下不打印相同的数字序列为其他人呢?

5A.XB.4X5C.X

54c.X5b.Xa.X

while(X<6)dowhile(X<5)dorepeat(printthevalueofX;

虽然(X<6)在(X<5)做重复(打印X的值;

(printthevalueofX;X+1;(XX+1)X

X+1)X+1,X(打印X的值;(X

X+1)XprintthevalueofX)until(X>6)

X+1)打印X的值),直到(XX>6)

9.Whichofthefollowingisnotawayofrepresentingalgorithms?

9。

下列哪一项不是代表算法的方式吗?

A.StepwiserefinementB.PseudocodeC.FlowchartD.Programminglanguage

a.逐步求精b.c.流程图d.编程语言的伪代码

10.WhichalgorithmswouldfindthenameKellymorequicklyinthelist:

John,Kelly,Lewis,Maurice,Nathan,Oliver,Pat,Quincy,Roger,Stan,Tom?

10。

这算法会发现这个名字凯利在列表中更快:

约翰,凯莉,刘易斯,莫里斯,内森,奥利弗,帕特,昆西,罗杰,斯坦,汤姆?

A.sequentialsearchB.binarysearch

a.顺序搜索b.二进制搜索

Fill-in-the-blank/Short-answerQuestions

填空/简答题

1.Anorderedcollectionofunambiguous,executablestepsthatdefinesaterminatingprocessiscalledA,andtherepresentationofanalgorithmisB.TheactionofexecutingaprogramisC.

1。

一个命令收集的明确的、可执行的步骤,定义了一个终止过程被称为,代表一个算法是B。

执行程序的作用是C。

2.Whatsequenceofvalueswillbeprintedwhenthefollowinginstructionsareexecuted?

2。

什么值序列将打印当以下执行指令?

5;X

5;X

if(X<7)then(printthevalue6;

如果(X<7)然后(打印值6;

6)Y

6)Y

else(printthevalue4;

其他(打印值4;

4)Y

4)Y

if(Y<5)then(printthevalue3)

如果(Y<5)然后(打印值3)

else(printthevalue2)

其他(打印值2)

_______________________

改善

3.WhatsequenceofvalueswouldbeprintediftheprocedurexxxdescribedbelowwereexecutedwithN=9?

3。

什么值序列将印刷如果程序xxx下面描述被N=9?

procedurexxx(N)

程序xxx(N)

if(N<4)then(printthevalueofN;

如果(N<4)然后(打印N值;

applytheprocedureyyytothevalue7)

应用程序yyy价值7)

else(applytheprocedureyyytothevalue2;

其他应用程序(yyy值2;

printthevalueofN)

打印N值)

procedureyyy(N)

程序yyy(N)

if(N<5)then(printthevalueofN;

如果(N<5)然后(打印N值;

applytheprocedurezzztothevalue6)

应用程序打鼾声到值6)

else(applytheprocedurezzztothevalue5)

其他(应用程序打鼾声价值5)

procedurezzz(N)

程序打鼾声(N)

if(N=5)then(printthevalue7)

如果(N=5)然后(打印值7)

else(printthevalue8)

其他(打印值8)

________________________

________________________

4.WhenusingbinarysearchalgorithmtosearchfortheletterXwithinthelist:

R,S,T,U,V,W,Z.Howmanyentrieswillbecheckedbeforediscoveringthattheletterisnotinthelist?

____________

4。

当使用二进制搜索算法搜索的字母X在列表:

R、S、T,U、V、W,z.有多少条目将被发现,这封信之前检查未在列表中呢?

_______

5.WhenusingsequentialsearchalgorithmtosearchfortheletterXwithinthelist:

R,S,T,U,V,W,Z.Howmanyentrieswillbecheckedbeforediscoveringthattheletterisnotinthelist?

____________

5。

当使用顺序搜索算法搜索的字母X在列表:

R、S、T,U、V、W,z.有多少条目将被发现,这封信之前检查未在列表中呢?

_______

6.SupposethebinarysearchalgorithmwasbeingusedtosearchfortheentryTominthelist:

6。

假设二进制搜索算法被用于搜索条目汤姆在列表中:

Nathan,Oliver,Pat,Quincy,Rodger,Stan,Tom

内森,奥利弗,帕特,昆西,罗杰,斯坦,汤姆

A.Whatwouldbethefirstentryinthelisttobeconsidered?

_____________

a.这将成为第一个条目列表中被认为是吗?

_________________

B.Whatwouldbethesecondentryinthelisttobeconsidered?

_____________

b.什么是第二个条目列表中被认为是吗?

_________________

7.Atmost,howmanyentriesinalistof5000nameswillbeinterrogatedwhenusingthesequentialsearchalgorithm?

___________

7。

最多,有多少条目列表的5000个名字将审讯当使用顺序搜索算法?

___________

8.WhichofthesequentialorbinarysearchalgorithmswouldfindthenameRogerinthefollowinglistmorequickly?

8。

哪个顺序或二进制搜索算法会发现这个名字罗杰在下面的列表更快吗?

John,Kelly,Lewis,Maurice,Nathan,Oliver,Pat,Quincy,Roger,Stan,Tom

约翰·凯利,刘易斯,莫里斯,内森,奥利弗,帕特,昆西,罗杰,斯坦,汤姆

_______________

售予

ANSWER:

Binary

答:

二进制

9.WhatsequenceofnumberswouldbeprintedifthefollowingprocedurewereexecutedwithN=0?

9。

什么数字序列将印刷如果下列程序被N=0?

procedurexxx(N)

程序xxx(N)

while(N<4)do

虽然(N<4)做的

(printthevalueofN;

(打印N值;

N+2;N

N+2;N

printthevalueofN

打印N值

__________________

_____________

10.WhatsequenceofnumberswouldbeprintedifthefollowingprocedurewereexecutedwithN=0?

10。

什么数字序列将印刷如果下列程序被N=0?

procedurexxx(N)

程序xxx(N)

printthevalueofN;

打印N值;

if(N<5)then(applytheprocedurexxxtothevalueN+2);

如果(N<5)然后(应用程序xxx值N+2);

printthevalueofN

打印N值

__________________

_____________

11.WhatsequenceofnumberswouldbeprintediftheprocedurexxxwereexecutedwithN=2?

11。

什么数字序列将印刷如果程序xxx被N=2?

procedurexxx(N)procedureyyy(N)

程序xxx(N)程序yyy(N)

printthevalueofN;printthevalueofN;

打印N值;打印N值;

if(N<3)applytheprocedurexxxtothevalue5;

如果(N<3)应用程序xxx价值5;

then(applyprocedureyyyprintthevalueofN

然后(应用程序yyy打印N值

tothevalue4);

价值4);

printthevalueofN

打印N值

_____________________

_____________________

12.Fillintheblankintheprocedurebelowsothattheprocedureprintstheintegersfrom0uptotheintegervalueitwasgivenforN.Thatis,iftheprocedureisexecutedwithN=3,itshouldprint0,1,2,3.

12。

填写空白在程序下面,以便程序打印整数从0到整数值是给出N.也就是说,如果执行的程序与N=3,它应该打印0、1、2、3。

procedurexxx(N)

程序xxx(N)

if(_________)then(applytheprocedurexxxtothevalueN-1);

如果(__)然后(应用程序xxx值N-1);

printthevalueofN)

打印N值)

Chapter6.ProgrammingLanguages

第六章。

编程语言

MultipleChoiceQuestions

多项选择题

1.Mostmachinelanguagesarebasedonthe.

1。

大多数机器语言是基于。

A.ImperativeparadigmB.Declarativeparadigm

a.命令式范式b.声明范例

C.FunctionalparadigmD.Object-orientedparadigm

c.功能范式d.面向对象的范例

2.WhichofthefollowingdoesnotrequireaBooleanstructure?

2。

下列哪个不需要一个布尔结构?

A.If-then-elsestatementB.Whileloopstatement

a.是以if-then-else语句b.While循环语句

C.AssignmentstatementD.Forloopstatement

c.赋值语句d.For循环语句

3.Whichofthefollowingisnotacontrolstatement?

3。

下列哪一项不是控制语句?

A.If-then-elsestatementB.Whileloopstatement

a.是以if-then-else语句b.While循环语句

C.AssignmentstatementD.Forloopstatement

c.赋值语句d.For循环语句

4.Whichofthefollowingisnotastepintheprocessoftranslatingaprogram?

4。

下列哪一项不是步骤在翻译过程中一个程序吗?

A.ExecutingtheprogramB.Parsingtheprogram

a.执行程序b.解析程序

C.LexicalanalysisD.Codegeneration

c.词法分析d.代码生成

5.Whichofthefollowingisnotassociatedwithobject-orientedprogramming?

5。

下列哪个不是面向对象编程相关?

A.InheritanceB.ResolutionC.EncapsulationD.Polymorphism

abc继承决议封装d多态性

6.Positionswithinarraysareidentifiedbymeansofnumberscalled.

6。

数组内的位置确定通过数字称。

A.IndicesB.ParametersC.InstancevariablesD.Constants

a.指数b.参数c.实例变量d.常量

7.Whichofthefollowingisignoredbyacompiler?

7。

以下是一个编译器忽略了吗?

A.ControlstatementsB.Declarationsofconstants

a.控制语句b.声明的常量

C.ProcedureheadersD.Commentstatements

c程序头d.注释语句

8.Whichofthefollowingisnotawayofreferringtoavalueinaprogram?

8。

下列哪一项不是方法能够引用一个值在一个程序吗?

A.VariableB.LiteralC.ConstantD.Type

abc.常数d变量文字类型

9.Whichofthefollowingisthescopeofavariable?

9。

以下是一个变量的范围?

A.Thenumberofcharactersinthevariable’sname

a中的字符数变量的名字

B.Theportionoftheprograminwhichthevariablecanbeaccessed

b.的部分计划,这些变量可以被访问

C.Thetypeassociatedwiththevariable

c类型相关的变量

D.Thestructureassociatedwiththevariable

d.的结构相关的变量

10.Whichofthefollowingisameansofnullifyingconflictsamongdatatypes?

10。

以下是一个消除的方法之间的冲突的数据类型?

A.InheritanceB.ParsingC.CoercionD.Codeoptimization

abc继承解析胁迫d.代码优化

11.Whichofthefollowingisnotconstructedbyatypicalcompiler?

11。

下列哪个不是通过一个典型的编译器构造吗?

A.SourcecodeB.SymboltableC.ParsetreeD.Objectprogram

abc源代码符号表解析树d.目标程序

12.Whichofthefollowingisameansofdefiningsimilarbutdifferentclassesinanobject-orientedprogram?

12。

以下是一个意味着定义相似但不同的类在一个面向对象的程序?

A.InheritanceB.ParsingC.CoercionD.Codeoptimization

abc继承解析胁迫d.代码优化

Fill-in-the-blank/Short-answerQuestions

填空/简答题

1.Indicatehoweachofthefollowingtypesofprogramminglanguagesisclassifiedintermsofgeneration(firstgeneration,secondgenera

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1