Skip to main content

Asymptotic Notation


What is Asymptotic Notation?
Asymptotic Notations are algorithms growth rate all languages allow us to analyze algorithms running time by identifying its behavior as an input size for the algorithms increases.

Common Rate of Growth
Comparing some efficiency of algorithms. We need some common growth rates. Let's assume n in the size of input and c some constant.
The following are the common rate of growth :
Logarithmic Function - log n 
Linear Function - an + b
Quadratic Function - an^2 + bn + c
Polynomial Function - an^z + ... + an^2 + a*n^1 + a*n^0, where z is some constant
Exponential Function - a^n, where a is some constant
When analyzing function considering the higher limit part of the function i.e linear function an + b here n is a large value with constant a.
Logarithmic - log n 
Linear  - n 
Quadratic - n^2
Polynomial - n^z, where z is some constant
Exponential - a^n, where a is some constant

Classifications of algorithms
  1. Big-O Notation: f(n) = Og(n)) if there are two positive constants c and n0 such that |f(n)| < c|g(n)| for all n >= n0. Big-O commonly written as O is an Asymptotic notation for the worst case. It provides as an asymptotic upper bound for the growth rate of the runtime of an algorithm.
  2. Big-Omega: Big-omega commonly written as Ω is an asymptotic notation for the best case or for the floor growth rate of a given function.
  3. Big-Theta: Big-Theta commonly written as Θ is an asymptotic notation for the average case or tight growth rate of a given function

Comments

Post a Comment

Popular posts from this blog

THE ORIGINS OF GOLANG

“Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.” - golang.org Go (as referred as Golang) was convinced in September 2007 by Robert Griesemer, Rob Pike, and Ken Thompson, and was announced on 10 November 2009. Go borrows and adapts good ideas from many others languages, and avoiding some features that have led to complexity and unreliable code. Golang facilities for concurrency are the new and efficient feature and its approach to data abstraction and object-oriented programming is unusually flexible, and it has automatic memory management (gc). Go is specially build infrastructure like network servers, and tools and systems for programmers. Go is an open-source project which is already mentioned in quotes, so for the source code for its compiler, libraries, and tools is freely available to anyone. Go runs on Unix like systems - Linux, FreeBSD, OpenBSD, Mac OS X and on Plan 9 and Micr...

Say Hello World with Golang

We will start with the traditional "Hello World" program which will appear in 1978 in the C programming language. C language influenced directly on Go. package main import "fmt" func main() { fmt.Println("Hello, 世界") } We assume that you have programmed in one or more languages whether compiled like c, c++, java or interpreted python, ruby, javascript. Go is compiled language. The Go toolchain converts source code. These toolchain accessed by a single command called  go  and multiple subcommands (run, build). $ go run hello_world.go prints - Hello World, 世界 Go handles Unicode. so it can process text in all languages. If the program is more than a one-shot experiment means we run a file any time without processing used build subcommand. $ go build hello_world.go This creates an executable binary file called hello. that file can run anywhere without further processing  $ ./hello_world Hello World, 世界 Let's ...