Algorithm Analysis: common functions, asymptotic notation
对于算法复杂度分析很多概念,自己理解的稀里糊涂的。或者好不容易弄明白了,隔一段时间又忘记了。特地整理记录在此
1. common functions used in analysis
constant, logarithmic, linear, N-log-N, quadratic, cubic, exponential
From best (least resource requirements ) to worst, the rankings are: O(1), O(logn), O(n), O(nlogn), O( n^2 ), O(n^3)O(2^n).
Graph: https://en.wikipedia.org/wiki/Analysis_of_algorithms
2. asymptotic notations
Big O, Little o, Theta, Omega, Little w
3. involved math knowledge
3.1 exponent
8^2 could be called "8 to the power 2" or "8 to the second power", or simply "8 squared"
5^3 could be called "5 to the third power", "5 to the power 3" or simply "5 cubed"
2^4 could be called "2 to the fourth power" or "2 to the power 4" or simply "2 to the 4th"
a^n tells you to multiply n times a by itself, so there are n of those a'
3.2 laws of exponent
3.3 logarithm
A Logarithm says how many of one number to multiply to get another number. Example, what is x in log3(x) = 5
Start with:log3(x) = 5. We want to "undo" the log3 so we can get "x ="
Use the Exponential Function (on both sides):
And we know that , so:x = 35
Answer:x = 243
3.4 Series
3.4.1 等差数列 Arithmetic Series
To sum up the terms of this arithmetic sequence:
a + (a+d) + (a+2d) + (a+3d) + ...
use this formula:
3.4.2 等比数列 Geometric Series
a + ar + ar^2 + ... + ar^(n-1)
Each term is ar^k, where k starts at 0 and goes up to n-1
Use this formula:
a is the first term
r is the "common ratio" between terms
n is the number of terms
4. Reference
Algebra
Calculus
Algorithm Analysis: common functions, asymptotic notation相关推荐
- Asymptotic Notation and Recurrences
Asymptotic notation Θ-notation Θ(g(n)) = {f(n) : there exist positive constants c1, c2, and n0 such ...
- 《Data Structures and Algorithm Analysis in C》学习与刷题笔记
<Data Structures and Algorithm Analysis in C>学习与刷题笔记 为什么要学习DSAAC? 某个月黑风高的夜晚,下班的我走在黯淡无光.冷清无人的冲之 ...
- Python_Example_ Data Structures and Algorithm Analysis 学习/示例
Author: 楚格 2018-11-19 19:05:11 IDE: Pycharm2018.02 Python 3.7 KeyWord : Data Structures and Alg ...
- Data Structures and algorithm analysis—1.3. A Brief Introduction to Recursion(数据结构—1.3 递归的简介)(之二)
Printing Out Numbers 打印数字 Suppose we have a positive integer, n, that we wish to print out. Our rout ...
- Data Structures and algorithm analysis—1.1 What's the book about? (数据结构1.1—关于本书)
CHAPTER 1: INTRODUCTION 第一章:简介 In this chapter, we discuss the aims and goals of this text and brief ...
- Lecture 2 Asymptotic Notation
- Flink java.lang.NoClassDefFoundError: org/apache/flink/api/common/functions/FlatMapFunction
- Flink-org.apache.flink.api.common.functions.AggregateFunction
该接口的注释上有很明白的代码例子在里面,本文只是简单的记录一下并且加上个人对这个接口的理解与不解,该签名如下 AggregateFunction<IN, ACC, OUT> 泛型IN指的是 ...
- 集束搜索(Beam Search Algorithm )
看计算机科学中最重要的32个算法,其中有个是集束搜索(又名定向搜索,Beam Search)--最佳优先搜索算法的优化.使用启发式函数评估它检查的每个节点的能力.不过,集束搜索只能在每个深度中发现前m ...
- 算法分析与设计CH3:Growth of Functions
CH3:Growth of Functions MindMap [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9nlpmj1u-1659616062952)(https ...
最新文章
- 领域驱动设计门槛很高,没有深厚的面向对象编码能力很难实践成功
- 厉害了程序员~凡尔赛文学现作 | 每日趣闻
- 用户界面线程AfxBeginThread的使用
- Kubernetes源码分析之kubelet
- Symbian编程总结-图形图像篇-打开非Bitmap类型的图像
- Myeclipse2017下使用Maven搭建的spring boot项目怎样运行?
- GDB 使用——Linux C编程
- matlab两张图片合成一张_两张图片合成一幅画意作品的简单方法
- Hybrid A*论文解析(5)
- 图解浏览器缓存,教你提高用户体验
- 一周死磕fastreport ----ASP.NET (二)
- minicom与USB转串口
- c# WinForm开发 DataGridView控件的各种操作总结(单元格操作,属性设置)
- 对封装继承多态的理解
- 线性定常系统的离散化
- 大数据学习之路-Hive
- android 红外驱动,Android内核驱动-红外驱动IR
- SQLI DUMB SERIES-6
- 如何快速的开发一个完整的iOS直播app(美颜篇)
- ETW绕过PoC测试1--关闭你的ProcMon.exe
热门文章
- DSP2812入门5——使用C语言操作DSP寄存器
- Builder中使用Access数据库
- ReactHooks——react-countdown倒计时——dayjs结合react-countdown
- 个人打卡签到表html代码,员工日常工作出勤签到登记表模板
- Linux操作系统——进程管理
- java kindeditor ssh,typecho KindEditor插件
- 微信小程序豆瓣电影实例源码下载
- 【Unity】【Odin Inspector】关于AOT Generation
- 贪吃蛇c加加代码_C语言/C加加编程学习之贪吃蛇小游戏源代码
- 使用ExtendSim进行医疗仿真