计算机科学与导论第13章.pdf

计算机科学与导论第13章.pdf

ID:53733830

大小:346.76 KB

页数:11页

时间:2020-04-20

计算机科学与导论第13章.pdf_第1页
计算机科学与导论第13章.pdf_第2页
计算机科学与导论第13章.pdf_第3页
计算机科学与导论第13章.pdf_第4页
计算机科学与导论第13章.pdf_第5页
资源描述:

《计算机科学与导论第13章.pdf》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、CHAPTER13FileStructures(SolutionstoReviewQuestionsandProblems)ReviewQuestionsQ13-1.Thetwoaccessmethodsaresequentialandrandom.Q13-2.Theoldmasterfileisthefilethatshouldbeupdated;thenewmasterfilecon-tainsthecurrentdata(thedatafromtheoldmasterfileincludinganychange

2、sthatweremadeduringtheupdateprocess).Q13-3.Thetransactionfilecontainschangesthatshouldbemadetotheoldmasterfile.Q13-4.Toaccessarecordinafilerandomly,weneedtoknowtheaddressoftherecord.Q13-5.Theindexisatablethatrelatesthekeysofthedataitemstotheaddressesinthefilewh

3、erethedataarestored.Q13-6.Indirecthashing,thekeyistheaddressoftherecordinthefile.Q13-7.Inmodulodivisionhashing,thekeyisdividedbythefilesize.Theremainderplus1isusedastheaddressoftherecordinthefile.Q13-8.Indigitextractionhashing,certaindigitsareremovedfromthekeya

4、ndusedastheaddressoftherecord.Q13-9.Acollisionoccurswhentwohashedrecordhavethesameaddress.Thethreecollisionmethodsareopenaddressing,linkedlistresolution,andbuckethash-ing.Inopenaddressing,theprimeareaissearchedforanunoccupiedaddress.Inlinkedlistresolution,thefi

5、rstrecordisstoredinthehomeaddress,butitcontainsapointertothesecondrecord.Inbuckethashing,agroupofrecordsarestoredinabucketswhicharelocationsthatcanaccommodatemorethanonerecord.Q13-10.Atextfileisafileofcharacterswhileabinaryfileisacollectionofdatastoredintheinte

6、rnalformatofthecomputer.12ProblemsP13-1.Thefilesareshownbelow:NewMasterFileErrorFileKeyNamePayRateActionKeyNamePayRate14JohnWu17.00A17MarthaKent17.0016GeorgeBrown18.0017DucLee11.0026TedWhite23.0031JoanneKing28.0089MarkBlack19.0090OrvaGilbert20.0092BetsyYellow14

7、.00P13-2.Bothdatafileandindexfileareshownbelow.IndexDatafileKeyAddressAddressKeyNameDept.077654004000123453JohnAdamCIS093245003001114237TedWhiteMTH114237001002156734JimmyLionsENG123453000003093245SophieGrandsBUS156734002004077654EvePrimaryCIS256743005005256743E

8、vaLindensENG423458006006423458BobBauerECOP13-3.a.(14232mod41)+1=5+1=6b.(12560mod41)+1=14+1=15c.(13450mod41)+1=2+1=3d.(15341mod41)+1=7+1=8P13-4.a.1422=20164→16b.1252=15625→62

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。