雨课堂在线学堂《算法设计与分析》作业单元考核答案_第1页
雨课堂在线学堂《算法设计与分析》作业单元考核答案_第2页
雨课堂在线学堂《算法设计与分析》作业单元考核答案_第3页
雨课堂在线学堂《算法设计与分析》作业单元考核答案_第4页
雨课堂在线学堂《算法设计与分析》作业单元考核答案_第5页
已阅读5页,还剩18页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1IntroductionofAlgorithm1

/4

单选题

(1分)Thereare3mennamedBob,JackandDavid,and3womennamedAnna,GraceandAlice.Theirpreferencelistsareshowedasfollows.Whichisastablematchingamongthefollowingmatchings?ABob-Grace,Jack-Anna,David-AliceBBob-Grace,Jack-Alice,David-AnnaCBob-Alice,Jack-Grace,David-Anna

答案A2/4单选题(1分)Giventhesame3menand3womenasexercise1.WhichoneistheresultofGale-Shapleyalgorithm?Bob-Grace,Jack-Anna,David-AliceBob-Alice,Jack-Grace,David-AnnaBob-Anna,Jack-Grace,David-Alice答案C3/4单选题(1分)Gale-Shapleyalgorithmfinds______.aperfectmatchingwithoutstabilitypossibledifferentassignmentsamongallexecutionstheman-optimalassignmentwhichisastablematching答案C4/4单选题(1分)Giventhesame3menand3womenasexercise1.WhichofthefollowingmisrepresentationcanmakeGraceobtainbetterpartnerforherselfinthereturnedmatching?Gracelies"IpreferDavidtoJack"Gracelies"IpreferJacktoBob"Gracelies"IpreferDavidtoBob"答案A2BasicsofAlgorithmAnalysis1/4单选题(1分)is_____.答案C2/4单选题(1分)Forevery,_____.答案B3/4单选题(1分)and,then_____.答案B4/4单选题(1分)Therearenumbers.Thetaskistocompute,,where.Therunningtimeofthefollowingalgorithmis_____.答案C3Graph

1

/4

单选题

(1分)Thereisanundirectedgraph

G=(V,E)with

V={1,2,3,4}

and

E={(1,2),(1,3),(2,4),(3,4)}

.Whichoneistheadjacencymatrixofit?AABBCC

答案A2/4单选题(1分)AgraphGisbipartiteiff_____.itcontainsnoevenlengthcycleitcontainsnooddlengthcycleitcontainsnocycle答案B3/4单选题(1分)Thereisadirectedgraphwithnodesandedges.Canonedetermineifisstronglyconnectedintime?YesNoDependingonand答案A4/4单选题(1分)Howmanytopologicalorderingsdoesithaveinthefollowinggraph?A1B2C3答案C4GreedyAlgorithms

1

/5

填空题

(1分)Theminimumspanningtreeofthefollowinggraphshouldcost____

答案["40"]

2

/5

填空题

(1分)TheshortestpathfromnodeAtonodeBinthefollowinggraphshouldcost

____

答案["19"]

3

/5

判断题

(1分)Decidewhetheryouthinkthefollowingstatementsaretrueorfalse.Let

G

beanarbitraryconnected,undirectedgraphwithadistinctcostoneveryedge.Suppose

e

isthecheapestedgein

G.

Then,thereisaminimumspanningtreeof

G

thatcontainstheedge

e.

答案√

4

/5

判断题

(1分)Underthesameconditionasexercise3.Then,

thereisnotaminimumspanningtreeof

G

thatdoesn’tcontaintheedge

e.

答案√5DivideandConquer

1

/4

单选题

(1分)Analgorithmhasrunningtime

T(n),whichsatisfies

T(n)=4T(n/4)+O(n).So,itsrunningtimeis_____.AO(nlog⁡n)BO(n)CO(n2)DO(n2log⁡n)

答案A

2

/4

单选题

(1分)Analgorithmhasrunningtime

T(n),whichsatisfies

T(n)≤T(n/2)+c

and

T(2)≤c.Thenitsrunningtimeis_____.AO(nlog⁡n)BO(n)CO(1)DO(log⁡n)

答案D

3

/4

单选题

(1分)InMergesortalgorithm,wedividetheinputintothreepiecesofequalsize(replacetwopieces);solvethethreesubproblemsonthesepiecesseparatelybyrecursion;andthencombinethethreeresultsintoanoverallsolution,spendingonlylineartimefortheinitialdivisionandfinalrecombining.Then,therunningtimeoftheabovealgorithmis_____.AO(nlog2⁡3log⁡n)BO(n2log⁡n)CO(nlog2⁡3)DO(nlog⁡n)

答案D

4

/4

单选题

(1分)Therunningtimeofthefollowingalgorithmforintegermultiplicationis_____.AO(n)BO(nlog⁡n)CO(nlog⁡3)DO(n2)

答案D6DynamicProgramming

1

/4

填空题

(1分)Thereisastairswithaheightof10steps.Youcanclimbstairsonlybytwoorthreesteps.

Soyoucangoby

____

differentkindsofways.

答案["7"]

2

/4

填空题

(1分)Thereare6objectswithvalues1,5,10,15,22,25,30.Aknapsackhascapacityofvalue69.

Ifwefillknapsacksoastomaximizetotalvalue,wecangetmaximumtotalvalue

____.

答案["68"]

3

/4

填空题

(1分)Usingdynamicprogrammingtosolvethefollowingintegerlinearprogramming,theobjectivevalueis____.

答案["50"]

4

/4

填空题

(1分)Ifyouonlycangouporrightinthebelowgraph,thenstartingfrompointAandendingtopointBshouldhave

____

differentways.

答案["135"]7NetworkFlow1

/4

判断题

(1分)Decidewhetheryouthinkthefollowingstatementistrueorfalse.

Let

G

beanarbitraryflownetwork,withasource

s,asink

t,andapositiveintegercapacity

ce

oneveryedge

e

.If

f

isamaximum

s−t

flowin

G

,then

f

saturateseveryedgeoutof

s

withflow(i.e.,foralledges

eoutof

s,wehavef(e)=ce).

答案×2

/4

判断题

(1分)Decidewhetheryouthinkthefollowingstatementistrueorfalse.

Let

G

beanarbitraryflownetwork,withasource

s,asink

t,andapositiveintegercapacity

ce

oneveryedge

e.Let

(A,B)

beamimimum

s−t

cutwithrespecttothesecapacities

{ce:e∈E}.Nowsupposeweadd1toeverycapacity,then

(A,B)

isstillaminimum

s−t

cutwithrespecttothesenewcapacities

{1+ce:e∈E}.

答案×3

/4

判断题

(1分)Decidewhetheryouthinkthefollowingstatementistrueorfalse.G

isaflownetworkwithamaximumflowwhichhasavalueof

v(f).Considertheflownetwork

G′

obtainedbyadding

1

tothecapacityofeveryedge.Thevalueofthemaximumflowin

G′

is

v(f)+1

.

答案×4

/4

填空题

(2分)Thebelowfigureshowsaflownetworkonwhichan

s−t

flowhasbeencomputed.Thecapacityofeachedgeappearsasalabelnexttotheedge,andthenumbersinboxesgivetheamountofflowsentoneachedge.(Edgeswithoutboxednumbershavenoflowbeingsentonthem.)

a)Thevalueofthisflowis

____.b)Thevalueofthemaximum

s−t

flowinthisgraphis

____.

答案["10"]2答案["11"]8NPandComputationalIntractability1/4判断题(1分)Forproblem,analgorithmwithrunningtimealwaysfasterthantheonewithrunningtimeforallinstances.答案×2/4单选题(1分)Ifwewanttoproofproblemcanbesolvedinpolynomial-timeviaareductionfromproblem,whichofthefollowingstatementisNOTnecessary?Arbitraryinstancesofproblemcanbesolvedinpolynomial-time.Arbitraryinstancesofproblemcanbesolvedusingpolynomialnumberofcallstooraclethatsolvesproblem.Arbitraryinstancesofproblemcanbesolvedusingpolynomialnumberofcallstooraclethatsolvesproblem.答案B3/4单选题(1分)Ifwehaveamagicmachinethatcansolve3-SATprobleminunittime.WhichofthefollowingproblemcanNOTbesolveifweonlyusethismachinepolynomialtimes?(AssumeP≠NP)INDEPENDENT-SETVERTEX-COVERPRIMESHALTINGPROBLEM答案D4/4单选题(1分)Assumethateachofthefollowingsetsarenotequal.Whichoneisthebiggestset?PNPco-NPEXP答案D9ApproximationAlgorithms1/4判断题(1分)Forproblem,a2-approximationalgorithmisalsoa3-approximationalgorithm.答案√2/4单选题(1分)Forproblem,nowwegeta3-approximationalgorithm.WhichofthefollowingstatementisTRUE?Thereisno-approximationalgorithmforforany.ProblemisNP-hard.Thealgorithmcangiveasolutionforanyinstanceofproblemwithinratio3oftrueoptimum.Problemcanbesolvedinpolynomialtime.答案C3/4单选题(1分)TheLPTrulegivesan-approximationalgorithmforloadbalancing.Whichofthefollowingfactorsisthebestfor.23/24/35/4答案C4/4判断题(1分)Inknapsackproblem,iftheweightofeachitemisintegerandlessthanagivenconstant.Wecansolveitinpolynomialtime.答案√10LocalSearch1/4判断题(1分)Alllocalsearchalgorithmscanstopinfinitesteps.答案×2/4单选题(1分)AssumetherearenodesinVERTEX-COVER.Thelocalsearchalgorithmgiveninthischaptercangiveasolutionwithinratio_____oftrueoptimumintheworst-case.23n-1n答案C3/4单选题(1分)Thesingle-flipneighborhoodalgorithmforMaximumCutwithnodesrunsatmost_____steps.答案D4/4判断题(1分)Thebestresponsedynamicsalgorithmfork-agentmulticastroutingproblemalwaysfindsthebestNashequilibrium.答案×11RandomizedAlgorithms1/3单选题(1分)Thereare8statementsandwehavenoknowledgeaboutthem.Werandomlyguessthemtrueorfalse.Sothepossibilitythatwecorrectlyguess6statementis_____.1/2569/25637/25693/256答案C2/3判断题(1分)Foranyinstanceof3-SAT,thereexistsatruthassignmentthatsatisfiesatleasta7/8fractionofallclauses.答案√3/3单选题(1分)GivenaMAX3-SATformulawithkclauses,weshowthattheexpectednumberofclausessatisfiedbyarandomassignmentis7k/8.Considerarandomassignmentforformula,theexpectednumberofclausessatisfiedis_____.7k/167k/87k/47k/2答案CExam1/11单选题(1分)Gale-Shapleyalgorithmfindsastablematchingin_____time.答案C2/11单选题(1分)is_____;is_____;is_____.答案A3/11单选题(1分)Abinarytreeisarootedtreeinwhicheachnodehasatmosttwochildren.Whatistherelationbetweenthenumberofnodeswithtwochildrenandthenumberofleaves(thenodeswithoutchildren)inabinarytree?答案C4/11单选题(1分)Supposewearegivenaninstanceoftheminmumspanningtreeproblemonagraph,withedgecoststhatareallpositiveanddistinct.Letbeaminimumspanningtreeforthisinstance.Nowsupposewereplaceeachedgecostbyitssquare,therebycreatinganewinstanceoftheproblemwiththesamegraphbutdifferentcosts.Decidewhetheryouthinkthefollowingstatementistrueorfalse.muststillbeaminimumspanningtreeforthisnewinstance.正确错误答案A5/11单选题(1分)Ifanalgorithmhasrunningtime,th

温馨提示

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

评论

0/150

提交评论