北京交通大学《数据结构》2017-2018学年期末试卷.docxVIP

  • 0
  • 0
  • 约8.07千字
  • 约 11页
  • 2026-01-21 发布于江西
  • 举报

北京交通大学《数据结构》2017-2018学年期末试卷.docx

北京交通大学软件学院

2017―2018学年第一学期期末考试试题

DataStructureandAlgorithmDesign(A)

Class:

____StudentNumber:

_____Name:________Teacher________

No.

I

II

III

IV

V

VI

Total

Mark

I.Single-Choice(20points)

1.Theheightofabinarytreethatcontains1023elementsisatmost( 1 ) andatleast( 2 ).

A.1022 B.1023 C.1024 D.9 E.10 F.11

2.Ifthesequenceofpushingelementsintoastackisa,b,c,whichoutput

sequenceisimpossible?(

).

C.cba

D.cab

A.abc

B.bca

3.Howmanyminimum-costspanningtreesarethereforanundirectedconnected

graphwithnverticesandeedges?(

)

C.n-e

D.notsure

A.mustbeonlyone

B.n-1

4.WhenusingtheadjacencymatrixAtorepresentaundirectedgraphwithnnodes

andeedges,thedegreeofthenodevicanbecomputedbyformula(

).

A.

B.

/2

C.e/2

D.

5.Intheworstcase,timecomplexityofquicksortwillbedegradedto(

).

A.O(n)

B.O(n2)

C.O(nlogn)

6.Inordertofindaspecifickeyinanorderedlistwith100keysusingbinarysearch

algorithm,themaximumtimesofcomparisonsis

(

).

A.

25

B.10

C.1

D.7

7.Considerthefollowingpseudo-code,whichindicatespartofastandardbinarytree algorithm.

print(node)

{

print

data;

if(thereisaleftchild) if(thereisarightchild)}

print(leftchild);

print(rightchild);

Whichofthefollowingisthestandardnameforthisalgorithm?( ) A.Inordertraversal B.Preordertraversal

C.Postordertraversal D. Binarysearch

8.WhichisnotthepropertyofaB-treeoforderm? ( )

A.Therootnodehasmsubtreeatmost

B.Allleafnodesareatthesamelevel.

C.Thekeysineverynodeareordered.

D.Allleafnodesareconnectedbylinks.

9.Supposethatwehave1000distinctintegers,whichareintherangefrom0to50.IfusingRadixSortaccordingtotheLeastSignificantDigitfirst,( )bucketsareneededtoconstructed.

A.10 B.50 C.51 D.1000

AnswertableforQuestionI (writeyouranswersofQuestionIhere)

1(1)

1(2)

2

3

4

5

6

7

8

9

B

E

D

D

A

B

D

B

D

A

II.Fillintheblank(2points*5)

AnswertableforII(PleasewriteyouranswersofIIhere)

1

2

2

3

4

preorder

11

2,3,⑤,5

i*n+j

5,4,3,2,1

1.Thestrategyofdepth-firstsearchingalgorithmforagraphissimilarto

thatof___

_traversalalgorithmforanormaltree.

2.Hereisahashtable,whosesi

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档