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 ...
随机推荐
- netty常用代码
一. Server public class TimeServer_argu { public void bind(int port) throws InterruptedException { Ev ...
- PLSQL_基础系列09_时间戳记TIMESTAMP(案例)
2013-11-09 Created By BaoXinjian
- redis使用日志(二) 数据存储到redis
一段简短的代码,来展示如何把爬取内容写到redis里面: #! /usr/bin/env python # -*- coding=utf-8 -*- import requests import js ...
- Coding 初级教程(一)——用GitHub的GUI客户端对Coding的项目进行管理
一.概述 二.Git基本概念 1.有关存储的四个概念 2.分支(branch) 三.项目管理实战操作 1.安装 GHfW(GitHub for Windows) 2.在Coding上新建一个项目(新建 ...
- CentOS 防火墙打开和关闭端口(转载)
From:http://jianzhong5137.blog.163.com/blog/static/982904920126202313376/ http://soft.chinabyte.com/ ...
- 深入研究java.lang.ThreadLocal类(转)
引用:http://lavasoft.blog.51cto.com/62575/51926/ 一.概述 ThreadLocal是什么呢?其实ThreadLocal并非是一个线程的本地实现版本,它并 ...
- 设置presentVC跟PushVC一样的效果即从右到左的动画
SettingViewController *VC = [[SettingViewControlleralloc]init]; VC.view.backgroundColor = [UIColorwh ...
- arm-linux-objcopy
被用来复制一个目标文件的内容到另一个文件中,可用于不同源文件的之间的格式转换示例: arm-linux-objcopy –O binary –S file.elf file.bin 常用的选项(大写) ...
- ORACLE 查看数据库中有哪些表
SELECT TABLE_NAME FROM USER_TABLES ORDER BY TABLE_NAME;
- python中的enumerate函数
enumerate 函数用于遍历序列中的元素以及它们的下标: >>> for i,j in enumerate(('a','b','c')): print i,j 0 a1 b2 c ...