Recurrence Algorithm Big-Oh Solution
Recurrence Algorithm Big-Oh Solution
T(n) = T(n/2) + O(1) Binary SearchO(log n)
T(n) = T(n-1) + O(1) Sequential SearchO(n)
T(n) = 2 T(n/2) + O(1) Tree TraversalO(n)
T(n) = T(n-1) + O(n) Selection Sort (other n2 sorts)O(n2)
T(n) = 2 T(n/2) + O(n) Mergesort (average case Quicksort)O(n log n)
T(n) = T(n - 1) + T(n - 2) + ..... + T(1) or T(n) = a + 2 * T(n - 1) Exponential
T(n) = n * T(n - 1) + O(1) Salesman Problem O(n!)

https://yourbasic.org/algorithms/time-complexity-recursive-functions/
Recurrence Algorithm Big-Oh Solution的更多相关文章
- Backtracking algorithm: rat in maze
Sept. 10, 2015 Study again the back tracking algorithm using recursive solution, rat in maze, a clas ...
- H-Index I & II
H-Index I Given an array of citations (each citation is a non-negative integer) of a researcher, wri ...
- 【LeetCode】242 - Valid Anagram
Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = &q ...
- Careercup - Google面试题 - 4716965625069568
2014-05-06 00:17 题目链接 原题: Given a -D matrix represents the room, obstacle and guard like the followi ...
- *[codility]GenomicRangeQuery
http://codility.com/demo/take-sample-test/genomicrangequery 这题有点意思.一开始以为是RMQ或者线段树,但这样要O(n*logn).考虑到只 ...
- *[codility]MaxCounters
http://codility.com/demo/take-sample-test/maxcounters 简单题.注意要记录两个max,一个是最大值,一个是已经生效的最大值. // you can ...
- the Linux Kernel: Traffic Control, Shaping and QoS
−Table of Contents Journey to the Center of the Linux Kernel: Traffic Control, Shaping and QoS 1 Int ...
- codility上的问题 (23)Chi 2012
这个题也比较有意思.意思是给定一个数组A,长度为M,里面都是正整数,代表每块地形的高度.现在要测试一种加农炮,给定一个炮弹的高度H, 如果存在最小的I,满足0 < I < M,满足A[I ...
- codility上的练习(3)
今天发现又出了lesson 3... 不过题目都很简单…… (1) Min-avg-slice 给定一个长度为n的整数数组,找到一个连续的子数组,数组元素的平均值最小. 数据范围N [1..10^5] ...
随机推荐
- 51nod 1051
* 最大子矩阵 * sum[i][j] 表示第 i 行前 j 列的和,即每一行的前缀 * i,j 指针枚举列,k指针枚举行 * Now 记录当前枚举的子矩阵的价值 * 由于记录了前缀信息,一旦 Now ...
- 一台服务器配置多个mysql实例
在公司资源紧张的情况下,需要在一台服务器上部署多个数据库实例,现在就来实战一下该情况. 需要启动两个不同的端口,分别是3306和3307 [root@node1 ~]# mkdir /u01/mysq ...
- kali系统firefox浏览器默认语言改为中文设置方法
kali中的Firefox浏览器默认为英文,这对英语不够好的我来讲,自然是很麻烦的,下面讲一下如何将语言设置为中文. 1.打开终端,输入 apt -y install firefox-esr-l10n ...
- k-means和iosdata聚类算法在生活案例中的运用
引言:聚类是将数据分成类或者簇的过程,从而使同簇的对象之间具有很高的相似度,而不同的簇的对象相似度则存在差异.聚类技术是一种迭代重定位技术,在我们的生活中也得到了广泛的运用,比如:零件分组.数据评价. ...
- 使用PyMySQL连接MySQL错误
使用PyMySQL连接MySQL错误 之前写了一个小项目,今天突然想起来,准备优化一下,但是原本好好的项目竟然跑不起来了 emmm....我真的啥都没干呀 具体错误是这样的: Traceback (m ...
- About Xi’an
Introduction Ancient Capital It is the birthplace of the Chinese Nation, is one of the four ancient ...
- kotlin之MutableMap委托
fun main(arg: Array<String>) { val map = mutableMapOf("name" to "tom", ) v ...
- [Java复习] Spring Framework 框架小结
Spring 总共大约有 20 个模块,由 1300 多个不同的文件构成. 而这些组件被分别整合在 核心容器 (Core Container), AOP(Aspect Oriented Pro ...
- 超详细MySQL安装及基本使用教程
一.下载MySQL 首先,去数据库的官网http://www.mysql.com下载MySQL. 点击进入后的首页如下: 然后点击downloads,community,选择MySQL Commun ...
- asp.net MVC AngularJS
http://www.cnblogs.com/powertoolsteam/category/834105.html