• 聚合分析
  • 核算法
  • 势能法
    c ^ i − c i = c r e d i t = Φ ( D i ) − Φ ( D i − 1 ) \hat c_i - c_i = credit = \Phi (D_i)- \Phi (D_{i-1}) c^i​−ci​=credit=Φ(Di​)−Φ(Di−1​)
    ∑ c ^ i = ∑ c i + Φ ( D − i ) − Φ ( D i − 1 ) \sum \hat c_i = \sum c_i + \Phi(D-i) - \Phi(D_{i-1}) ∑c^i​=∑ci​+Φ(D−i)−Φ(Di−1​)

合并两个skew heap摊还时间为O(logN)

exercises


C
A light child has at most half weight of its parents. Thus if there are k light nodes not including x along the path from x to y, w ( y ) ≤ w ( x ) / 2 k w(y) \leq w(x)/2^k w(y)≤w(x)/2k ( k ≤ l o g w ( x ) w ( y ) k \leq log \frac{w(x)}{w(y)} k≤logw(y)w(x)​ )
Φ \Phi Φ = the total number of right heavy nodes it contains
By lemma 2, any path in a skew heap contains only O(logn) light nodes
Any heavy node on such a path is converted from right to left by causing a drop of one in the potential
Two heaps h 1 h_1 h1​ and h 2 h_2 h2​, containing n 1 n_1 n1​ and n 2 n_2 n2​ items
n = n 1 + n 2 n = n_1 + n_2 n=n1​+n2​
By lemma 1, the total number of light nodes is at most 2 ⌊ l o g n ⌋ − 1 2 \lfloor logn \rfloor -1 2⌊logn⌋−1
Let k 1 k_1 k1​ and k 2 k_2 k2​ be the number of heavy nodes on the right path of h 1 h_1 h1​ and h 2 h_2 h2​, and k 3 k_3 k3​ be the number of nodes that become right heavy children of nodes on the merge path.
By lemma 2, k 3 ≤ ⌊ l o g n ⌋ k_3 \leq \lfloor logn \rfloor k3​≤⌊logn⌋
the number of node on the merge path is at most
c i ≤ 2 + ⌊ l o g n 1 ⌋ + k 1 + ⌊ l o g n 2 ⌋ + k 2 ≤ 1 + 2 ⌊ l o g n ⌋ + k 1 + k 2 c_i \leq 2+ \lfloor logn_1 \rfloor + k_1 + \lfloor logn_2 \rfloor + k_2 \leq 1 + 2 \lfloor logn \rfloor + k_1 + k_2 ci​≤2+⌊logn1​⌋+k1​+⌊logn2​⌋+k2​≤1+2⌊logn⌋+k1​+k2​
The increase in the potential caused by the merge is Δ Φ = k 3 − k 2 − k 1 = ⌊ l o g n ⌋ − k 1 − k 2 \Delta \Phi = k_3 - k_2 - k_1 = \lfloor logn \rfloor - k_1 - k_2 ΔΦ=k3​−k2​−k1​=⌊logn⌋−k1​−k2​
This the amortized is at most 3 ⌊ l o g n ⌋ + 1 3 \lfloor logn \rfloor + 1 3⌊logn⌋+1

https://blog.csdn.net/Woolseyyy/article/details/51517446

Amortized analysis相关推荐

  1. Lecture 13 Amortized Analysis

  2. 平摊分析(Amortized Analysis)-- Potential Method

    势能方法将已预付的工作表示成一种"势能",在需要的时候可以释放出来,以支付后面的操作.势是与整个数据结构而不是其中的个别对象发生联系的. 开始时,先对一个初始数据结构D_0执行n个 ...

  3. Amortized Analysis(平摊分析)

         分析的核心是数据结构. Cost(Increment)指的是一次+1付出的代价.每次至多增加一个"1". 置一次1将来有置0的均等的次数.   必须要满足这个条件:  这 ...

  4. 坚持完成这套学习手册,你就可以去 Google 面试了

    from: http://geek.csdn.net/news/detail/107064 本文为掘金投稿,译文出自:掘金翻译计划 原文地址:Google Interview University 原 ...

  5. 关于 std::set/std::map 的几个为什么

    2013-01-20 std::set/std::map (以下用 std::map 代表) 是常用的关联式容器,也是 ADT(抽象数据类型).也就是说,其接口(不是 OO 意义下的 interfac ...

  6. java 数组合并_数组与链表

    CPU L1缓存读写速度高出内存100倍左右, 缓存在加载地址的时候,基于Locality of reference也会加载相邻的地址内容.(如果一个地址被访问,那么它相邻的地址也极有可能之后被访问) ...

  7. 最长回文子串——Manacher 算法​​​​​​​

    0. 问题定义 最长回文子串问题:给定一个字符串,求它的最长回文子串长度. 如果一个字符串正着读和反着读是一样的,那它就是回文串.下面是一些回文串的实例: 12321 a aba abba aaaa ...

  8. 编程常用英语词汇 | GitHub

    Table of Contents A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 专业名词 A 英文 译法 1 译法 2 译法 3 a blo ...

  9. [编程常用英语词汇]

    [编程常用英语词汇] A 英文 译法 1 译法 2 译法 3 a block of pointers 一块指针 一组指针 abbreviation 缩略语 abstract 抽象的 abstract ...

最新文章

  1. C#杂记系列之日期函数
  2. 【建站系列教程】5、谈一谈网站的静态化
  3. MAC Opencv include选择
  4. 图的两种存储方式---邻接矩阵和邻接表
  5. nyoj359Delete it
  6. Arduino学习笔记⑦ EEPROM断电保存数据
  7. windows下Java 用idea连接MySQL数据库
  8. C++编绎器编绎C语言的问题
  9. 性能测试的重要意义(一)
  10. pmw调光c语言程序,51单片机led灯渐变PWM调光(渐亮渐灭)C语言和汇编源程序
  11. zabbix监控redis
  12. 关于通过ServletContext获取数据出现的http500的错误的解决方案
  13. Flutter实战一Flutter聊天应用(十一)
  14. java常用的库_java有哪些常用的库
  15. Windows勒索病毒补丁下载
  16. java 货币格式 转换_java格式化数值成货币格式示例
  17. 不清楚Word如何批量转PDF?快来跟我学这两个妙招
  18. 产品思维30讲(梁宁)-- 整体
  19. 知识付费的本质是什么?现在入行知识付费行业晚吗?
  20. 会php学java入门要多久_php自学需要多久

热门文章

  1. 亿图图示Windows12.5版本,满足用户多元化绘图需求
  2. Moving Tables(贪心)
  3. 图片音视频应用开发的工具与服务大礼包
  4. el-from表单验证(数字,中文,手机号,邮箱,英文)
  5. Cesium-3D Tiles 跳跃式层级细节
  6. 图文实录|多模态自然语言处理最新进展
  7. (附源码)ssm物流公司员工管理系统 毕业设计 261625
  8. 眼镜度数1500能学计算机吗,近视1500度怎么办
  9. Matlab中图像函数大全 - [基础知识]
  10. Android二维码识别与生成