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 ...
随机推荐
- [运维-服务器 – 1A] – nginx.conf(转)
#定义Nginx运行的用户和用户组user www www; #nginx进程数,建议设置为等于CPU总核心数.worker_processes 8; #全局错误日志定义类型,[ debug | in ...
- PLSQL_闪回删除FlashBack Delete表误删除如何进行恢复(案例)
2014-07-02 Created By BaoXinjian
- [实变函数]3.1 外测度 (outer measure)
1 并不是所有的集合都可求测度. 我们的想法是先对 $\bbR^n$ 中的任一集合定义一个``外 测度'' (outer measure), 然后再加上适当的条件 (Caratheodory 条件), ...
- 【转】select和epoll模型的差异
http://www.cppblog.com/converse/archive/2008/10/12/63836.html epoll为什么这么快 epoll是多路复用IO(I/O Multiplex ...
- URI
1, URI (标识.定位任何资源的字符串) 在电脑术语中,统一资源标识符(Uniform Resource Identifier,或URI)是一个用于标识某一互联网资源名称的字符串. 该种标识允许用 ...
- Web Uploader文件上传&&使用webupload有感(黄色部分)
引入资源 使用Web Uploader文件上传需要引入三种资源:JS, CSS, SWF. <!--引入CSS--> <link rel="stylesheet" ...
- SQL Server 2005中的分区表(四):删除(合并)一个分区(转)
在前面我们介绍过如何创建和使用一个分区表,并举了一个例子,将不 同年份的数据放在不同的物理分区表里.具体的分区方式为: 第1个小表:2010-1-1以前的数据(不包含2010-1-1). 第2个小表: ...
- dedeCMS安装,前端样式不显示
因为dedeCMS样式引用用的是绝对路径:dede默认安装在网站的根目录. 所以,解决方法有三种: 1.修改代码路径,很不推荐,那么多页面可操作性低: 2.直接安装在站点根目录www目录,也行,但是容 ...
- shell 统计 awk
time awk '{a[$1]++}END{for(i in a){printf("%d\t%s\n",a[i],i)}}' access.log | sort -nr | he ...
- cocos2dx 菜单按钮回调方法传参 tag传参
.h文件 void menuCallBack(CCObject* pSender); .cpp CCMenuItemSprite* item = CCMenuItemSprite::create( m ...