11填空已知数组A如下:3790796676802742采用低位优先法的基数排序进行升序排序的第一轮之后的排序结果为?(数字间以一个空格分隔)ThearrayAisknownas:3790796676802742Dotheascendingsortbyradixsortingwiththeleastsignificantdigitfirst(LSD),whatistheresultofthefirstround?(Thenumbersareseparatedbyaspace)
12填空计划对磁带中的16条数据:{18,43,38,16,4,28,7,99,19,54,42,6,74,17,63,3}进行排序。若排序过程中使用大小为3的堆,则对上述数据采用置换选择算法,所得最长的顺串为___________________________。(数字之间用空格分隔)Plantosortthese16piecesofdata:{18,43,38,16,4,28,7,99,19,54,42,6,74,17,63,3}.Ifweuseaheap,whosesizeis3,tosortthedata,andthealgorithmis”replacementselection”,thenthelongestrunwillbe_______________(separatethenumberbyaspace)
13单选假定有k个关键码互为同义词,即hash函数结果相同,若采用闭散列的线性探测法把这k个关键字存入散列表中,至少要进行()次探测?Iftherearekkeyvalueswhicharesynonymsofeachother,whichmeanstheirreturnvaluesofhashfunctionaresame,ifweinsertthesekkeyvaluesintothehashtablebylinearprobingofclosedhashing,weneedtoprobeatleast()times.
A.k
B.k-1
C.k*(k+1)/2
D.k+1
14填空分块检索中,若索引表和各块内均用顺序查找,则有900个元素的线性表分成()块最好Intheblockingsearch,ifweusesequentialsearchtotheindextableandeachblock,thenthelineartablewhichhas900elementsshouldbedividedinto()partsatbest.
15单选一个散列表的散列函数是h(key)=key%19,共有20个槽,用闭散列的线性探查方法。从空表开始,依次进行如下插入删除操作,问这些操作的平均检索长度是:提示:散列表中不能插入两个相同的关键码Thereisahashtableofsize20,itshashingfunctionish(key)=key%19.Weuselinearprobingofclosedhashing.Westartfromanemptytable,inturns,performthefollowinginsertoperationsanddeleteoperations,askyouwhatistheaveragelengthofretrieval:(Expresstheanswerbyintegerorfraction.)Hint:wecan’tinserttwosamekeyvaluesintoahashtable.Add26Add25Add24Add195Del26Add176Add45
A.15/7
B.17/7
C.2
D.16/5
数据结构与算法
北京大学
军职在线答案
大学网课