CLRS:master theory in complexity of algorithm
T(n)=aT(n/b)+f(n);
where we can interpret n/b to mean either floor(b/n) or ceil(b/n), Then T (n) has the following asymptotic bounds:
1. If f (n)= O(nlogb a-c) for some constant c> 0, then T (n)=Θ(nlogb a)
2.If f (n)= Θ(nlogb a), then T (n)=Θ(nlogb a log n)
3. If f (n)= Ω(nlogb a+c) for some constant c> 0, and if af (n/b)>= cf (n) for
some constant c < 1 and all sufficiently large n, then T (n)= Θ(f(n)).
//
comments:
compare the f(n) and b logb a,and the max will determine the complexity of the recurrence.
in case 1 and case 3 ,the larger determine the complexity of the recurrence,
in case 2,they are the same size ,so,there add a factor log n.
besides all the comparison must be polynomically smaller or larger.
CLRS:master theory in complexity of algorithm的更多相关文章
- No.004:Median of Two Sorted Arrays
问题: There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the ...
- No.023:Merge k Sorted Lists
问题: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexit ...
- Cognition math based on Factor Space (2016.05)
Cognition math based on Factor Space Wang P Z1, Ouyang H2, Zhong Y X3, He H C4 1Intelligence Enginee ...
- 关于并行计算的Scan操作
simple and common parallel algorithm building block is the all-prefix-sums operation. In this chapte ...
- (转)Awesome Courses
Awesome Courses Introduction There is a lot of hidden treasure lying within university pages scatte ...
- A Gentle Guide to Machine Learning
A Gentle Guide to Machine Learning Machine Learning is a subfield within Artificial Intelligence tha ...
- No.006:ZigZag Conversion
问题: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows l ...
- No.005:Longest Palindromic Substring
问题: Given a string S, find the longest palindromic substring in S. You may assume that the maximum l ...
- No.026:Remove Duplicates from Sorted Array
问题: Given a sorted array, remove the duplicates in place such that each element appear only once and ...
随机推荐
- (WPF, Service) 删除注册表中的USB Enum值.
Task: 删除HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_0XXX&PID_0XXX Key Tree 首先第一想到的使 ...
- Java的安全性和可移植性
Java的这两个特性,关键在于Java编译器的输出并不是可执行的代码,而是字节码 bytecode. 字节码是一套设计用来在Java运行时系统下执行的高度优化的指令集,该Java运行 ...
- IGS_学习笔记06_IREP发布客户化集成接口为Web Service(案例)
2015-01-03 Created By BaoXinjian
- Report_客制化以PLSQL输出HTML标记实现WEB报表(案例)
2014-05-31 Created By BaoXinjian
- UVA116 单向 DSP(多段图最短路)
单向 DSP [题目链接]单向 DSP [题目类型]dp &题解: 紫书P271 这块的字典序排序我觉得挺厉害的,每次都把那3步sort一下,之后if (v< d[i][j]) 这块的小 ...
- POJ 1740 A New Stone Game(普通博弈)
A New Stone Game 题意: 对于n堆石子,每堆若干个,两人轮流操作,每次操作分两步,第一步从某堆中去掉至少一个,第二步(可省略)把该堆剩余石子的一部分分给其它的某些堆.最后谁无子可取即输 ...
- 关于centos7下扩充和减小xfs逻辑分区大小的问题
比如,我想把/dev/centos/home下的50G变为8G 1.增加 1.1 去掉挂载 umount /home 1.2 减小home, lvreduce -L 8G /dev/centos/ho ...
- mysql函数计算地表两点间距离
DELIMITER $$ CREATE FUNCTION `test`.`getDistance`(LatBegin FLOAT(10,4), LngBegin FLOAT(10,4), LatEnd ...
- 保存恢复临时信-Android 中使用onSaveInstanceState和onRestoreInstanceState
在Activity中,有两个方法用于临时保存.恢复状态信息,这两个方法是: public void onSaveInstanceState(Bundle savedInstanceState); pu ...
- MODBUS-寄存器与功能码学习
分类 简称 起始地址 结束地址 能够使用的功能码 输出逻辑线圈/(可读写位)/(DI/O)(如继电器开关控制) 0x 00000 09999 0x01读一组逻辑线圈 0x05写单个线圈 0x0f写多个 ...