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 ...
随机推荐
- Java的最大优势还是跨平台么?
之前码农界有码农说Java的最大优势是跨平台,真的是这样么?其实当时网络没这么火爆的时候,确实是这样的,但现在这已然不是了. 跨平台还是Java的最大优势么? 有跨平台需求的仅仅是客户端应用,而不是服 ...
- DBA_Oracle Erp R12安装虚拟机镜像IP修正(案例)
2014-07-12 Created By BaoXinjian
- 转_ _android开发中如何结束所有的activity
每一个activity都有自己的生命周期,被打开了最终就要被关闭. 四种结束当前的activity方法 Java代码: //关闭当前activity方法一 finish(); //关闭当前界面方法 ...
- Java拾穗
1.Class.forName("com.wzh.test.loadClass"); Class.forName("com.mysql.jdbc.Driver" ...
- Python标准库04 文件管理 (部分os包,shutil包)
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 在操作系统下,用户可以通过操作系统的命令来管理文件,参考linux文件管理相关命令 ...
- 原始ajax发起请求并反馈
在用户登陆的时候,离开用户.密码输入框即进行验证:ajax发起请求进行验证的: login.jsp代码: <%@ page language="java" contentTy ...
- Android使用KSOAP2调用WebService及正确导入jar包的问题(转)
Android使用KSOAP2调用WebService及正确导入jar包的问题(转) 错误信息 最近在学Android使用KSOAP2调用现有的Webservice的方法,期间在网上找了很多代 ...
- awk 两列相减
cat http.txt |awk -F ':' '{print($2-$3)}' 百度文库
- free 查看系统内存
第二部分(-/+ buffers/cache):(-buffers/cache) used内存数:286M (指的第一部分Mem行中的used – buffers – cached)(+buffers ...
- [POJ 2923] Relocation (动态规划 状态压缩)
题目链接:http://poj.org/problem?id=2923 题目的大概意思是,有两辆车a和b,a车的最大承重为A,b车的最大承重为B.有n个家具需要从一个地方搬运到另一个地方,两辆车同时开 ...