- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Amortized Analysis (chap. 17).ppt
Amortized costs: more cases insert, delete α ≥ 1/2, α 1/2 (use αi, since α can vary a lot) size does/doesn’t change Amortized cost for each operation Splay tree A binary search tree (not balanced) Height may be larger than log n, even n-1. However a sequence of n operations takes O(nlog n). Assumptions: data values are distinct and form a totally order set Operations: Member(i,S) Insert(i,S) Delete(i,S) Merge(S,S’) Split(i,S) All based on splay(i,S), reorganize tree so that i to be root if i?S, otherwise, the new root is either max{k ?S |ki} or min{k ?S |ki} Splay tree (cont.) For examples, merge(S,S’) Call Splay(?, S) and then make S’ the right child Delete(i,S), call Splay(i,S), remove I, then merge(left(i), right(i)). Similar for others. Constant number of splays called. Splay tree (cont.) Splay operation is based on basic rotate(x) operation (either left or right). Three cases: y is the parent of x and x has not grandparent rotate(x) x is the left (or right) child of y and y is the left (or right) child of z, rotate(y) and then rotate(x)\ x is the left (or right) child of y and y is the right (or left) child of z, rotate(x) and then rotate(x) Splay tree (cont.) Credit invariant: Node x always has at least log ?(x) credits on deposit. Where ?(S)=log (|S|) and ?(x)=?(S(x)) Lemma: Each operation splay(x,S) requires no more than 3(?(S)-?(x))+1 credits to perform the operation and maintain the credit invariant. Theorem: A sequence of m operations involving n inserts takes time O(mlog(n)). Summary Amortized analysis Different from probabilistic analysis Three methods and their differences how to analyze Amortized Analysis (chap. 17) Not just consider one operation, but a sequence of operations on a given data structure. Average cost over a sequence of operations. Probabilistic analysis: Average case running time: average over all possible inputs for one algorithm (operation). If using probability, called expected running time. Amortized analysis: No in
您可能关注的文档
- 2012~2013学年度第一学期教研组长会.ppt
- 2012肇庆市二模试题评讲.ppt
- 2013 ESC 冠心病热点聚焦.ppt
- 2013-2014学年第一学期八年级数学期末考试质量分析.ppt
- 2013桐庐县九年级音乐监测样卷 得分一、听辨.ppt
- 2014年广东中考历史.ppt
- 2015 美丽宜居小镇说明材料模板.ppt
- 2015年1%抽样方案.ppt
- 2015年甘肃万名备考指导公益讲座.ppt
- 2020以内的数的认识——复习.ppt
- An Intro to AIX Virtualization.ppt
- An Introduction to Electronic System Level Design.ppt
- An Unidentified Poisoning.ppt
- ANAB AQMS Accreditation Programs2005.ppt
- Analog to Digital Converters.ppt
- Analytical Techniques.ppt
- Analyzing Browse Patterns of Mobile Clients.ppt
- ANALYZING THE BUSINESS LANDSCAPE.ppt
- Android底层开发.ppt
- Andy---The Android.ppt
最近下载
- ISO27001 2022版内审全套资料(内审计划+检查表+审核报告等).doc
- fidic99版新红皮书中英文双语对照版.docx VIP
- 钢板弹簧设计计算程序Ver1.0-20070405.xls VIP
- 区块链产业学院建设思路与规划.pptx VIP
- 建筑外门窗气密、水密、抗风压性能分级(1).doc VIP
- 读本低年级 第2讲《一心跟着共产党》第二课时《党和人民心连心》教学课件.pptx VIP
- 数控车床高级工理论考试题库(含答案).docx VIP
- 《WPS Office办公应用案例教程》教学课件 项目8 WPS Office App文档的基本应用.ppt VIP
- 《WPS Office办公应用案例教程》教学课件 项目9 WPS Office App表格和演示文稿的应用.ppt VIP
- 通用质量特性工作计划-模板.docx VIP
文档评论(0)