版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Improve Run GenerationOverlap input,output, and internal CPU work.Reduce the number of runs (equivalently, increase average run length).DISKMEMORYDISKInternal Quick Sort6285111041973Use 6 as the pivot (median of 3).Input first, middle, and last blocks first.In-place partitioning.Input blocks from th
2、e ends toward the middle.Sort left and right groups recursively.Can begin output as soon as left most block is ready.4235161011978Alternative Internal Sort SchemeDISKDISKB1B2B3Partition into 3 buffers.Steady State OperationRead from diskWrite to diskRun generationSynchronization is done when the act
3、ive input buffer gets empty (the active output buffer will be full at this time).DISKMEMORYDISKNew StrategyUse 2 input and 2 output buffers.Rest of memory is used for a min loser tree.Input 1Input 0Output 0Output 1Loser TreeSteady State OperationRead from diskWrite to diskRun generationSynchronizati
4、on is done when the active input buffer gets empty (the active output buffer will be full at this time).4368157326945258438O0O1I0I1InitializeFill From Disk43681573269452584683517InitializeO0O1I0I1Fill From Disk436815732694525846835371629InitializeO0O1I0I1Fill From Disk4368157326945258468353725281649
5、InitializeO0O1I0I1Fill From Disk4368157326945258468353725581649InitializeO0O1I0I1Fill From Disk4368157326945258468353725582649InitializeO0O1I0I1Fill From DiskGenerate Run 11436857326945258468353725582649O0O1I0I1354Fill From DiskFill From TreeGenerate Run 1436857326945258468353725582649O0O1I0I1354Fil
6、l From DiskFill From Tree1335O023Generate Run 143685736945258468353725583649O1I0I1354Fill From DiskFill From Tree15445O023Generate Run 143685736945258468353725583649O1I0I1354Fill From DiskFill From Tree154Interchange Role Of Buffers5O02343685736945258468353725583649O1I0I1Fill From DiskWrite To Disk1
7、544Interchange Role Of Buffers192Fill From Tree5O02343685736945258468353745583649O1I0I1Fill From DiskWrite To Disk1544192Fill From TreeContinue With Run 1O1345O0243685736945258468353745584649I0I1Fill From DiskWrite To Disk151192Fill From TreeContinue With Run 1151O1345O024368573694525846835374558464
8、9I0I1Fill From DiskWrite To Disk151192Fill From TreeContinue With Run 15995791O1345O0243685736945258468353745584649I0I1Fill From DiskWrite To Disk151192Fill From TreeContinue With Run 159572Interchange Role Of Buffers91O1345O04368573694558468353745584649I0I1Fill From DiskWrite To Disk51613Fill From
9、Tree59572Interchange Role Of Buffers91O1345O04368573694558468353745584649I0I1Fill From DiskWrite To Disk51613Fill From Tree59572Continue With Run 12291O1345O04368573694558468353745584649I0I1Fill From DiskWrite To Disk51613Fill From Tree5957Continue With Run 12665291O1345O0436857369455846835374558464
10、9I0I1Fill From DiskWrite To Disk51613Fill From Tree5957Continue With Run 126651195Let k be number of external nodes in loser tree.Run size = k.Sorted input = 1 run.Reverse of sorted input = n/k runs.Average run size is 2k.RUN SIZEMemory capacity = m records.Run size using fill memory, sort, and outp
11、ut run scheme = m.Use loser tree scheme.Assume block size is b records.Need memory for 4 buffers (4b records).Loser tree k = m 4b.Average run size = 2k = 2(m 4b).2k = m when m = 8b.ComparisonAssume b = 100.Comparisonm6001000500010000k200 6004600 96002k4001200920019200Total internal processing time using fill memory, sort, and output run scheme = O(n/m) m log m) = O(n log m).Total internal processing time using lo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 三上第14课 在线协作学习 教案 浙教版(2023)信息科技
- 第11课 北洋政府的统治与军阀割据 教案
- 冀教版四年级上册除法练习300道及答案
- 毕业生企业接收函(3篇)
- 2024年口腔医师工作计划范文(3篇)
- 超市主管工作总结范文
- 部队述职报告个人范文简短(7篇)
- 财务会计实习总结11篇
- 24年22全科汉听初赛复习测试有答案
- 7.2正负数(基础作业)2024-2025学年四年级上册数学 北师大版(含解析)
- 牛津自然拼读课件Phonics worldJKL
- 数字贸易学 课件 第5章 数字服务贸易
- 全国职业院校技能大赛(酒水服务)考试题库(含答案)
- 2022年4月自考00659新闻摄影试题及答案含解析
- 科学教学指导专委会工作职责
- 《为什么要证明》示范公开课教学设计【北师大版八年级数学上册】
- 风险防控方案及安全保障措施
- 水雨情监测站施工方案
- 水果物流配送存在的问题及对策研究-以广州百果园连锁店为例
- 英语老师家长会课件-图文
- 铸牢中华民族共同体教案范文(通用篇)
评论
0/150
提交评论