




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 季節(jié)性用工合同規(guī)定
- 采購合同修訂協(xié)議
- 廣場舞合同范本
- 旅館住宿合同范本
- 19剃頭大師教學設計-2024-2025學年三年級下冊語文統(tǒng)編版
- 4 氣味告訴我們 教學設計-2024-2025學年科學一年級上冊教科版
- 圓木采購合同范本
- 煤炭安全協(xié)議合同范本
- Module 8 Unit 1 教學設計 2024-2025學年外研版八年級英語下冊
- 2023-2024學年清華版(2012)信息技術三年級上冊第四單元《14課 一句一景色-“復制”和“裁剪”圖片》教學設計
- 人教版(2025版)七年級下冊英語UNIT 1 Animal Friends 單元整體教學設計(6個課時)
- 項目管理知識手冊指南
- 2025年春季學期學校德育工作計劃及安排表
- 2025年常熟市招聘進村人員歷年高頻重點提升(共500題)附帶答案詳解
- (主城一診)重慶市2025年高2025屆高三學業(yè)質量調研抽測 (第一次)物理試卷(含答案)
- 2025年中國電信集團有限公司招聘筆試參考題庫含答案解析
- DB50T 393-2011 城市三維建模技術規(guī)范
- 《肺癌圍手術期護理》課件
- 《糖尿病足護理查房》課件
- 山東省臨沂市地圖矢量課件模板()
評論
0/150
提交評論