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的更多相关文章

  1. Backtracking algorithm: rat in maze

    Sept. 10, 2015 Study again the back tracking algorithm using recursive solution, rat in maze, a clas ...

  2. H-Index I & II

    H-Index I Given an array of citations (each citation is a non-negative integer) of a researcher, wri ...

  3. 【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 ...

  4. Careercup - Google面试题 - 4716965625069568

    2014-05-06 00:17 题目链接 原题: Given a -D matrix represents the room, obstacle and guard like the followi ...

  5. *[codility]GenomicRangeQuery

    http://codility.com/demo/take-sample-test/genomicrangequery 这题有点意思.一开始以为是RMQ或者线段树,但这样要O(n*logn).考虑到只 ...

  6. *[codility]MaxCounters

    http://codility.com/demo/take-sample-test/maxcounters 简单题.注意要记录两个max,一个是最大值,一个是已经生效的最大值. // you can ...

  7. 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 ...

  8. codility上的问题 (23)Chi 2012

    这个题也比较有意思.意思是给定一个数组A,长度为M,里面都是正整数,代表每块地形的高度.现在要测试一种加农炮,给定一个炮弹的高度H, 如果存在最小的I,满足0 < I <  M,满足A[I ...

  9. codility上的练习(3)

    今天发现又出了lesson 3... 不过题目都很简单…… (1) Min-avg-slice 给定一个长度为n的整数数组,找到一个连续的子数组,数组元素的平均值最小. 数据范围N [1..10^5] ...

随机推荐

  1. JAVA的带参数的方法

    一.带参数的方法 1.1 语法:                            <访问修饰符>  返回类型  <方法名>(<形式参数列表>) { //方法的 ...

  2. leetcode解题报告(9):Implement strStr()

    描述 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if nee ...

  3. [Qt Quick] qmlscene 工具的使用

    qmlscene是Qt 5提供的一个查看qml文件效果的工具.特点是不需要编译应用程序. qmlscene = qml + scene (场景) qmlscene.exe位于Qt的安装目录下 (类似/ ...

  4. ECMAScript 5.0 基础语法(下)“稍微重点一点点”

    接上篇 七.常用内置对象(复杂数据类型)(重点) (1)数组Array 创建:例  var colors = ['red','blue','green']       #推荐这样,因为简单粗暴 或:v ...

  5. 内存管理2-set方法的内存管理

    1.对象之间的内存管理: 每个学生都有一本书 book类 @price 学生类  @age @book -------------------- #import "book.h" ...

  6. java试题复盘——11月13日

    上: 10. AccessViolationException异常触发后,下列程序的输出结果为(   A   ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 AccessViol ...

  7. navicat连接远程数据库报错'client does not support authentication protocol requested by server consider ...'解决方案

    [1.cmd终端连接远程mysql数据库方法] mysql -uhello -pworld   -h192.168.1.88 -P3306 -Dmysql_oa mysql -u用户名 -p密码 -h ...

  8. Programming a Hearthstone agent using Monte Carlo Tree Search(chapter one)

    Markus Heikki AnderssonHåkon HelgesenHesselberg Master of Science in Computer Science Submission dat ...

  9. 阿里云上搭建git

    这篇文章我就来介绍一下如何在一台全裸的阿里云主机上搭建自己的git服务器. 1. 安装git 首先安装git,一般而言,现在的服务器已经内置了git安装包,我们只需要执行简单的安装命令即可安装.比如: ...

  10. jQuery源码解读----part 2

    分离构造器 通过new操作符构建一个对象,一般经过四步: A.创建一个新对象 B.将构造函数的作用域赋给新对象(所以this就指向了这个新对象) C.执行构造函数中的代码 D.返回这个新对象 最后一点 ...