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] ...
随机推荐
- PHP mysqli_errno() 函数
返回最近调用函数的最后一个错误代码: <?php // 假定数据库用户名:root,密码:123456,数据库:RUNOOB $con=mysqli_connect("localhos ...
- react 后台(一) react + redux + react-route + webpack+ axios + antd + less
create-react-app 项目名称(项目失败,ant 的样式出不来) 项目技术栈 react + redux + react-route + webpack+ axios + less + a ...
- MySQL数据分析实战-朱元禄-专题视频课程
MySQL数据分析实战-496人已学习 课程介绍 本套课程由知名数据分析博主jacky老师录制,深入浅出讲解MySQL数据分析,从实战角度出发,帮助大家制胜职场!课程收益 1.学会 ...
- 初次接触webpack
1.学习地址 中文文档 https://www.webpackjs.com/concepts/ webpack-dev-server配置说明 https://www.webpackjs.com/con ...
- Spring框架IOC解说
控制反转——Spring通过一种称作控制反转(IoC)的技术促进了松耦合.当应用了IoC,一个对象依赖的其它对象会通过被动的方式传递进来,而不是这个对象自己创建或者查找依赖对象.你可以认为IoC与JN ...
- ROS Topic 常用指令
rostopic list rosnode list一樣,就是列出目前運行中的topic有哪些. rostopic echo <topic_name> 接下來這個指令比較重要啦,就是去監聽 ...
- csp-s模拟95
近两场开始文件评测,感觉和平时真不太一样. 考试时间是多了$10min$,但处理文件.输入输出什么的杂事也是忙来忙去.这可能也最像真实的$csps$了,稍有疏忽可能都是致命伤. T1.T2挂的对拍全打 ...
- 微信小程序倒计时的方法
timeOut: function(time) { var that = this; var end = new Date(time).getTime(); var Interval = setInt ...
- Google Python Style Guide
https://google.github.io/styleguide/pyguide.html
- Docker-compose的安装和使用
一.简介 Compose 项目 是 Docker 官方的开源项目 , 负 责实 现对 Docker 容器 集群的快速编排,其前身 是开源项目 Fig, 目前仍然兼容 Fig格式的模板文件. 使用 一个 ...