Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 991 Bytes

ComplexityAnalysis.md

File metadata and controls

31 lines (20 loc) · 991 Bytes

#Complexity Analysis

[TOC]

##Big-O Notation

This operation means "order of" and is used to describe the general behaviour of an algorithm.

We can calculate the complexity of an algorithm by many delimeters. One common way is to count the number of in terms your input, and the complexity will be the greatest power of 'n' in that equasion.

##Synbols of Complexity

Ο - The "order of" operator, defines worst case complexity. Θ - Defines the general average complexity. Ω - Defines best-case complexity.

##Properties of Big-O

  1. If f(n) = O(g(n)) and g(n) is O(h(n)) then f(n) = O(h(n)).
  2. If f(n) = O(h(n))) and g(n) = O(h(n)) then f(n) + g(n) is O(h(n)).
  3. ank = O(nk).
  4. nk = O(nk+j) for any j > 0.
  5. If f(n) = c.g(n) then f(n) = O(g(n)).
  6. logan = O(logbn) for any a,b >1
  7. logan is O(log2n) for any positive a ≠1.

Regan Koopmans, 2016