版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Analysis Of Fibonacci HeapsMaxDegreeLet Ni = min # of nodes in any min (sub)tree whose root has i children.N0 = 1. N1 = 2.695Ni , i 1Children of b are labeled in the order in which they became children of b.c1 became a child before c2 did, and so on.So, when ck became a child of b, degree(b) = k 1.d
2、egree(ck) at the time when ck became a child of b = degree(b) at the time when ck became a child of b = k 1.bc1c2ciNi , i 1So, current degree(ck) = max0, k 2.So, Ni = N0 + (S0=q=i-2 Nq ) + 1 = (S0=q 1 = (S0=q 1.N0 = 1.N1 = 2.Ni = (S0=q 1.Ni = Fi+2 (1 + sqrt(5)/2)i , i = 0.MaxDegreeMaxDegree = logfn,
3、 where f = (1 + sqrt(5)/2.Accounting MethodInsert.Guessed amortized cost = 2.Use 1 unit to pay for the actual cost of the insert and keep the remaining 1 unit as a credit for a future remove min operation.Keep this credit with the min tree that is created by the insert operation.Meld.Guessed amortiz
4、ed cost = 1.Use 1 unit to pay for the actual cost of the meld.Remove Nonmin Element87316592867410495theNode695Remove Nonmin Element8731659286741095695Guessed amortized cost = 2logfn + 3.Use logfn units to pay for setting parent fields to null for subtrees of deleted node.Use 1 unit to pay for remain
5、ing work not related to cascading cut. Remove Nonmin Element8731659286741095695Keep logfn units to pay for possible future pairwise combining of the new top-level trees created.Kept as 1 credit per new top-level tree.Discard excess credits (if any).Remove Nonmin Element8731659286741095695Keep 1 unit
6、 to pay for the time when node whose ChildCut field is set to true is cut from its parent, and another 1 unit for the pairwise combining of the cut subtree.Remove Nonmin Element8731659286741095695Keep the 2 credits on the node (if any) whose ChildCut field is set to true by the ensuing cascading cut
7、 operation.If there is no such node, discard the credits.Remove Nonmin ElementGuessed amortized cost = 2logfn + 3.Use logfn units to pay for setting parent fields to null.Use 1 unit to pay for remaining work not related to cascading cut. Keep 1 unit to pay for the time when node whose ChildCut field
8、 is set to true is cut from its parent, and another 1 unit for the pairwise combining of the cut subtree.Keep logfn units to pay for possible future pairwise combining of the new top-level trees created.Remove Nonmin ElementPlacement of credits.Keep 1 unit on each of the newly created top-level tree
9、s.Keep 2 units on the node (if any) whose ChildCut field is set to true by the ensuing cascading cut operation.Discard the remaining credits (if any).DecreaseKey(theNode, theAmount)87316592867410495theNode695DecreaseKey(theNode, theAmount)10095873165928674695Guessed amortized cost = 4.DecreaseKey(th
10、eNode, theAmount)10095873165928674695Use 1 unit to pay for work not related to cascading cut. DecreaseKey(theNode, theAmount)10095873165928674695Keep 1 unit to pay for possible future pairwise combining of the new top-level tree created whose root is theNode.Kept as credit on theNode.DecreaseKey(the
11、Node, theAmount)10095873165928674695Keep 1 unit to pay for the time when node whose ChildCut field is set to true is cut from its parent, and use another 1 unit for the pairwise combining of the cut subtree. DecreaseKey(theNode, theAmount)10095873165928674695Keep the 2 credits on the node (if any) w
12、hose ChildCut field is set to true by the ensuing cascading cut operation.If there is no such node, discard the credits.Decrease KeyGuessed amortized cost = 4.Use 1 unit to pay for work not related to cascading cut. Keep 1 unit to pay for the time when node whose ChildCut field is set to true is cut
13、 from its parent, and use another 1 unit for the pairwise combining of the cut subtree.Keep 1 unit to pay for possible future pairwise combining of the new top-level tree created whose root is theNode.Decrease KeyKeep the 2 credits on the node (if any) whose ChildCut field is set to true by the ensu
14、ing cascading cut operation.If there is no such node, discard the credits.Remove MinGuessed amortized cost = 3logfn.Actual cost = 2logfn 1 + #MinTrees.Allocation of amortized cost.Use 2logfn 1 to pay part of actual cost.Keep remaining logfn + 1 as a credit to pay part of the actual cost of a future rem
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025版生態(tài)環(huán)境保護與修復(fù)項目環(huán)境監(jiān)測合同范本3篇
- 藥品生物科技行業(yè)助理工作概況
- 2024年現(xiàn)代農(nóng)業(yè)科技示范苗圃場地租賃協(xié)議書3篇
- 《串聯(lián)的并聯(lián)》課件
- 2024新發(fā)行地方政府債券合同示范文本3篇
- 《上海世博會招商版》課件
- 金融投資話務(wù)員工作總結(jié)
- 二零二五年專業(yè)金融機構(gòu)董事聘用及風(fēng)險控制協(xié)議2篇
- 家具裝飾業(yè)務(wù)投資合作協(xié)議三篇
- 教育培訓(xùn)行業(yè)授課技巧培訓(xùn)心得
- 小學(xué)一年級數(shù)學(xué)思維訓(xùn)練100題(附答案)
- 安全生產(chǎn)治本攻堅三年行動方案(一般工貿(mào)) 2024
- 2024年廣東省廣州市黃埔區(qū)中考一模語文試題及答案
- 公路施工表格
- 飯?zhí)脪炜繀f(xié)議合同范本
- 2023-2024學(xué)年遼寧省重點高中沈陽市郊聯(lián)體高二上學(xué)期期末考試生物試題(解析版)
- 借款分期還款合同
- 醫(yī)學(xué)史第三版重點
- 2024版建行借款合同范本
- CQI-8分層過程審核指南(附全套表格)
- 教科版五年級上冊科學(xué)期末測試卷及參考答案(完整版)
評論
0/150
提交評論